tests

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: Apache-2.0, UNKNOWN, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AminoTagTypes = []any{
	(*FuzzWriteEmpty)(nil),
	(*FuzzNilElements)(nil),
}

AminoTagTypes are struct types that use amino-specific encoding tags (write_empty, nil_elements) with no proto3 equivalent. These need a tailored test that skips the proto.Marshal byte comparison.

View Source
var DefTypes = []any{
	(*IntDef)(nil),
	(*IntAr)(nil),
	(*IntSl)(nil),
	(*ByteAr)(nil),
	(*ByteSl)(nil),
	(*PrimitivesStructSl)(nil),
	(*PrimitivesStructDef)(nil),
}
View Source
var Package = pkg.NewPackage(
	"github.com/gnolang/gno/tm2/pkg/amino/tests",
	"tests",
	pkg.GetCallersDirname(),
).WithDependencies().WithTypes(
	EmptyStruct{},
	PrimitivesStruct{},
	ShortArraysStruct{},
	ArraysStruct{},
	ArraysArraysStruct{},
	SlicesStruct{},
	SlicesSlicesStruct{},
	PointersStruct{},
	PointerSlicesStruct{},

	ComplexSt{},
	EmbeddedSt1{},
	EmbeddedSt2{},
	EmbeddedSt3{},
	EmbeddedSt4{},
	pkg.Type{
		Type:             reflect.TypeOf(EmbeddedSt5{}),
		Name:             "EmbeddedSt5NameOverride",
		PointerPreferred: false,
	},
	AminoMarshalerStruct1{},
	ReprStruct1{},
	AminoMarshalerStruct2{},
	ReprElem2{},
	AminoMarshalerStruct3{},
	AminoMarshalerInt4(0),
	AminoMarshalerInt5(0),
	AminoMarshalerStruct6{},
	AminoMarshalerStruct7{},
	ReprElem7{},
	IntDef(0),
	IntAr{},
	IntSl(nil),
	ByteAr{},
	ByteSl(nil),
	PrimitivesStructDef{},
	PrimitivesStructSl(nil),
	PrimitivesStructAr{},
	Concrete1{},
	Concrete2{},
	ConcreteRecursive{},
	ConcreteTypeDef{},
	ConcreteWrappedBytes{},
	&InterfaceFieldsStruct{},

	GnoVMPos{},
	GnoVMSpan{},
	GnoVMLocation{},
	GnoVMAttrs{},
	GnoVMObjectID{},
	GnoVMObjectInfo{},
	GnoVMTypedValue{},
	GnoVMBlock{},
	GnoVMFuncValue{},
	GnoVMDeclaredType{},
	GnoVMRefValue{},
	GnoVMFieldType{},
	GnoVMStructType{},
	GnoVMFileNode{},
	GnoVMPointerValue{},
	GnoVMSliceValue{},
	GnoVMMapEntry{},
	GnoVMNode{},

	FuzzFieldInfo{},
	FuzzStructInfo{},
	FuzzValueEntry{},
	FuzzBlock{},
	FuzzFuncInfo{},
	FuzzDeclInfo{},
	FuzzFileInfo{},
	FuzzPtrNest{},
	FuzzDeepNest{},

	FuzzUnsafeFloat{},
	FuzzWriteEmpty{},
	FuzzNilElements{},
	FuzzFixedInt{},
	FuzzContainsAminoMarshaler{},

	EmptyReprOnZero{},
	FuzzNilEmptyRepr{},

	SimpleAddress{},
	HostRepr{},
	CounterRepr(0),
	ContainerWithAminoLists{},
	StructWithStringRepr{},
	StructPtrSliceWithStringRepr{},
	ByteArraySliceStruct{},
	FixedStringArrayStruct{},
	StructUint8ReprSliceStruct{},

	CrossPkgPointerSlice{},
	CrossPkgBoxedRepr{},

	InterfaceHeavy{},
)

Creates one much like amino.RegisterPackage, but without registration. This is needed due to circular dependency issues for dependencies of Amino. Another reason to strive for many independent modules. NOTE: Register new repr types here as well. NOTE: This package registration is independent of test registration. See tests/common.go StructTypes etc to add to tests.

Functions

This section is empty.

Types

type AminoMarshalerInt4

type AminoMarshalerInt4 int32

func (AminoMarshalerInt4) MarshalAmino

func (am AminoMarshalerInt4) MarshalAmino() (ReprStruct4, error)

func (AminoMarshalerInt4) MarshalBinary2

func (goo AminoMarshalerInt4) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (AminoMarshalerInt4) SizeBinary2

func (goo AminoMarshalerInt4) SizeBinary2(cdc *amino.Codec) (int, error)

func (*AminoMarshalerInt4) UnmarshalAmino

func (am *AminoMarshalerInt4) UnmarshalAmino(rs ReprStruct4) error

func (*AminoMarshalerInt4) UnmarshalBinary2

func (goo *AminoMarshalerInt4) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type AminoMarshalerInt5

type AminoMarshalerInt5 int32

func (AminoMarshalerInt5) MarshalAmino

func (am AminoMarshalerInt5) MarshalAmino() (string, error)

func (AminoMarshalerInt5) MarshalBinary2

func (goo AminoMarshalerInt5) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (AminoMarshalerInt5) SizeBinary2

func (goo AminoMarshalerInt5) SizeBinary2(cdc *amino.Codec) (int, error)

func (*AminoMarshalerInt5) UnmarshalAmino

func (am *AminoMarshalerInt5) UnmarshalAmino(repr string) error

func (*AminoMarshalerInt5) UnmarshalBinary2

func (goo *AminoMarshalerInt5) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type AminoMarshalerStruct1

type AminoMarshalerStruct1 struct {
	A int32
	B int32
}

func (AminoMarshalerStruct1) MarshalAmino

func (ams AminoMarshalerStruct1) MarshalAmino() (ReprStruct1, error)

func (AminoMarshalerStruct1) MarshalBinary2

func (goo AminoMarshalerStruct1) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (AminoMarshalerStruct1) SizeBinary2

func (goo AminoMarshalerStruct1) SizeBinary2(cdc *amino.Codec) (int, error)

func (*AminoMarshalerStruct1) UnmarshalAmino

func (ams *AminoMarshalerStruct1) UnmarshalAmino(rs ReprStruct1) error

func (*AminoMarshalerStruct1) UnmarshalBinary2

func (goo *AminoMarshalerStruct1) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type AminoMarshalerStruct2

type AminoMarshalerStruct2 struct {
	B int32 // exposed (dontcare)
	// contains filtered or unexported fields
}

func (AminoMarshalerStruct2) MarshalAmino

func (ams AminoMarshalerStruct2) MarshalAmino() ([]ReprElem2, error)

func (AminoMarshalerStruct2) MarshalBinary2

func (goo AminoMarshalerStruct2) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (AminoMarshalerStruct2) SizeBinary2

func (goo AminoMarshalerStruct2) SizeBinary2(cdc *amino.Codec) (int, error)

func (*AminoMarshalerStruct2) UnmarshalAmino

func (ams *AminoMarshalerStruct2) UnmarshalAmino(repr []ReprElem2) error

func (*AminoMarshalerStruct2) UnmarshalBinary2

func (goo *AminoMarshalerStruct2) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type AminoMarshalerStruct3

type AminoMarshalerStruct3 struct {
	A int32
}

func (AminoMarshalerStruct3) MarshalAmino

func (ams AminoMarshalerStruct3) MarshalAmino() (int32, error)

func (AminoMarshalerStruct3) MarshalBinary2

func (goo AminoMarshalerStruct3) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (AminoMarshalerStruct3) SizeBinary2

func (goo AminoMarshalerStruct3) SizeBinary2(cdc *amino.Codec) (int, error)

func (*AminoMarshalerStruct3) UnmarshalAmino

func (ams *AminoMarshalerStruct3) UnmarshalAmino(i int32) error

func (*AminoMarshalerStruct3) UnmarshalBinary2

func (goo *AminoMarshalerStruct3) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type AminoMarshalerStruct6

type AminoMarshalerStruct6 struct {
	A int32
	B int32
}

func (AminoMarshalerStruct6) MarshalAmino

func (ams AminoMarshalerStruct6) MarshalAmino() ([]AminoMarshalerStruct1, error)

func (AminoMarshalerStruct6) MarshalBinary2

func (goo AminoMarshalerStruct6) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (AminoMarshalerStruct6) SizeBinary2

func (goo AminoMarshalerStruct6) SizeBinary2(cdc *amino.Codec) (int, error)

func (*AminoMarshalerStruct6) UnmarshalAmino

func (ams *AminoMarshalerStruct6) UnmarshalAmino(repr []AminoMarshalerStruct1) error

func (*AminoMarshalerStruct6) UnmarshalBinary2

func (goo *AminoMarshalerStruct6) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type AminoMarshalerStruct7

type AminoMarshalerStruct7 struct {
	A int8
}

func (AminoMarshalerStruct7) MarshalAmino

func (ams AminoMarshalerStruct7) MarshalAmino() ([]ReprElem7, error)

func (AminoMarshalerStruct7) MarshalBinary2

func (goo AminoMarshalerStruct7) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (AminoMarshalerStruct7) SizeBinary2

func (goo AminoMarshalerStruct7) SizeBinary2(cdc *amino.Codec) (int, error)

func (*AminoMarshalerStruct7) UnmarshalAmino

func (ams *AminoMarshalerStruct7) UnmarshalAmino(repr []ReprElem7) error

func (*AminoMarshalerStruct7) UnmarshalBinary2

func (goo *AminoMarshalerStruct7) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ArraysArraysStruct

type ArraysArraysStruct struct {
	Int8ArAr        [2][2]int8
	Int16ArAr       [2][2]int16
	Int32ArAr       [2][2]int32
	Int32FixedArAr  [2][2]int32 `binary:"fixed32"`
	Int64ArAr       [2][2]int64
	Int64FixedArAr  [2][2]int64 `binary:"fixed64"`
	IntArAr         [2][2]int
	ByteArAr        [2][2]byte
	Uint8ArAr       [2][2]uint8
	Uint16ArAr      [2][2]uint16
	Uint32ArAr      [2][2]uint32
	Uint32FixedArAr [2][2]uint32 `binary:"fixed32"`
	Uint64ArAr      [2][2]uint64
	Uint64FixedArAr [2][2]uint64 `binary:"fixed64"`
	UintArAr        [2][2]uint
	StrArAr         [2][2]string
	BytesArAr       [2][2][]byte
	TimeArAr        [2][2]time.Time
	DurationArAr    [2][2]time.Duration
	EmptyArAr       [2][2]EmptyStruct
}

func (ArraysArraysStruct) MarshalBinary2

func (goo ArraysArraysStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ArraysArraysStruct) SizeBinary2

func (goo ArraysArraysStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ArraysArraysStruct) UnmarshalBinary2

func (goo *ArraysArraysStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ArraysStruct

type ArraysStruct struct {
	Int8Ar        [4]int8
	Int16Ar       [4]int16
	Int32Ar       [4]int32
	Int32FixedAr  [4]int32 `binary:"fixed32"`
	Int64Ar       [4]int64
	Int64FixedAr  [4]int64 `binary:"fixed64"`
	IntAr         [4]int
	ByteAr        [4]byte
	Uint8Ar       [4]uint8
	Uint16Ar      [4]uint16
	Uint32Ar      [4]uint32
	Uint32FixedAr [4]uint32 `binary:"fixed32"`
	Uint64Ar      [4]uint64
	Uint64FixedAr [4]uint64 `binary:"fixed64"`
	UintAr        [4]uint
	StrAr         [4]string
	BytesAr       [4][]byte
	TimeAr        [4]time.Time
	DurationAr    [4]time.Duration
	EmptyAr       [4]EmptyStruct
}

func (ArraysStruct) MarshalBinary2

func (goo ArraysStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ArraysStruct) SizeBinary2

func (goo ArraysStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ArraysStruct) UnmarshalBinary2

func (goo *ArraysStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ByteAr

type ByteAr [4]byte

This will be encoded as message SomeName { bytes val = 1; }

func (ByteAr) MarshalBinary2

func (goo ByteAr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ByteAr) SizeBinary2

func (goo ByteAr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ByteAr) UnmarshalBinary2

func (goo *ByteAr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ByteArraySliceStruct

type ByteArraySliceStruct struct {
	Items [][8]byte
}

ByteArraySliceStruct: a struct with a `[][8]byte` field. Each element is a fixed-size 8-byte array, decoded as a list element via writePrimitiveDecodeFrom's Array+Uint8 branch. Exercises the byte-array element length check: the generator must enforce that the decoded payload length matches the array length, mirroring reflect (binary_decode.go:551-555).

func (ByteArraySliceStruct) MarshalBinary2

func (goo ByteArraySliceStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ByteArraySliceStruct) SizeBinary2

func (goo ByteArraySliceStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ByteArraySliceStruct) UnmarshalBinary2

func (goo *ByteArraySliceStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ByteSl

type ByteSl []byte

This will be encoded as message SomeName { bytes val = 1; }

func (ByteSl) MarshalBinary2

func (goo ByteSl) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ByteSl) SizeBinary2

func (goo ByteSl) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ByteSl) UnmarshalBinary2

func (goo *ByteSl) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ComplexSt

type ComplexSt struct {
	PrField PrimitivesStruct
	ArField ArraysStruct
	SlField SlicesStruct
	PtField PointersStruct
}

func (ComplexSt) MarshalBinary2

func (goo ComplexSt) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ComplexSt) SizeBinary2

func (goo ComplexSt) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ComplexSt) UnmarshalBinary2

func (goo *ComplexSt) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Concrete1

type Concrete1 struct{}

func (Concrete1) AssertInterface1

func (Concrete1) AssertInterface1()

func (Concrete1) AssertInterface2

func (Concrete1) AssertInterface2()

func (Concrete1) MarshalBinary2

func (goo Concrete1) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (Concrete1) SizeBinary2

func (goo Concrete1) SizeBinary2(cdc *amino.Codec) (int, error)

func (*Concrete1) UnmarshalBinary2

func (goo *Concrete1) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Concrete2

type Concrete2 struct{}

func (Concrete2) AssertInterface1

func (Concrete2) AssertInterface1()

func (Concrete2) AssertInterface2

func (Concrete2) AssertInterface2()

func (Concrete2) MarshalBinary2

func (goo Concrete2) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (Concrete2) SizeBinary2

func (goo Concrete2) SizeBinary2(cdc *amino.Codec) (int, error)

func (*Concrete2) UnmarshalBinary2

func (goo *Concrete2) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ConcreteRecursive

type ConcreteRecursive struct {
	Inner Interface1
}

ConcreteRecursive implements Interface1 and has an Interface1 field, allowing unbounded nesting for depth-limit testing.

func (ConcreteRecursive) AssertInterface1

func (ConcreteRecursive) AssertInterface1()

func (ConcreteRecursive) MarshalBinary2

func (goo ConcreteRecursive) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ConcreteRecursive) SizeBinary2

func (goo ConcreteRecursive) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ConcreteRecursive) UnmarshalBinary2

func (goo *ConcreteRecursive) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ConcreteTypeDef

type ConcreteTypeDef [4]byte

Special case: this concrete implementation (of Interface1) is a type definition.

func (ConcreteTypeDef) AssertInterface1

func (ConcreteTypeDef) AssertInterface1()

func (ConcreteTypeDef) MarshalBinary2

func (goo ConcreteTypeDef) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ConcreteTypeDef) SizeBinary2

func (goo ConcreteTypeDef) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ConcreteTypeDef) UnmarshalBinary2

func (goo *ConcreteTypeDef) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ConcreteWrappedBytes

type ConcreteWrappedBytes struct {
	Value []byte
}

Ideally, user's of amino should refrain from using the above but wrap actual values in structs; e.g. like:

func (ConcreteWrappedBytes) AssertInterface1

func (ConcreteWrappedBytes) AssertInterface1()

func (ConcreteWrappedBytes) MarshalBinary2

func (goo ConcreteWrappedBytes) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ConcreteWrappedBytes) SizeBinary2

func (goo ConcreteWrappedBytes) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ConcreteWrappedBytes) UnmarshalBinary2

func (goo *ConcreteWrappedBytes) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ContainerWithAminoLists

type ContainerWithAminoLists struct {
	Addrs    []SimpleAddress  // slice, string repr
	TopAddrs [3]SimpleAddress // array, string repr
}

func (ContainerWithAminoLists) MarshalBinary2

func (goo ContainerWithAminoLists) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ContainerWithAminoLists) SizeBinary2

func (goo ContainerWithAminoLists) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ContainerWithAminoLists) UnmarshalBinary2

func (goo *ContainerWithAminoLists) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type CounterRepr

type CounterRepr uint8

func (CounterRepr) MarshalAmino

func (c CounterRepr) MarshalAmino() (uint8, error)

func (CounterRepr) MarshalBinary2

func (goo CounterRepr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (CounterRepr) SizeBinary2

func (goo CounterRepr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*CounterRepr) UnmarshalAmino

func (c *CounterRepr) UnmarshalAmino(repr uint8) error

func (*CounterRepr) UnmarshalBinary2

func (goo *CounterRepr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type CrossPkgBoxedRepr

type CrossPkgBoxedRepr struct {
	Val int64
}

func (CrossPkgBoxedRepr) MarshalAmino

func (c CrossPkgBoxedRepr) MarshalAmino() (crosspkg.Inner, error)

func (CrossPkgBoxedRepr) MarshalBinary2

func (goo CrossPkgBoxedRepr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (CrossPkgBoxedRepr) SizeBinary2

func (goo CrossPkgBoxedRepr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*CrossPkgBoxedRepr) UnmarshalAmino

func (c *CrossPkgBoxedRepr) UnmarshalAmino(r crosspkg.Inner) error

func (*CrossPkgBoxedRepr) UnmarshalBinary2

func (goo *CrossPkgBoxedRepr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type CrossPkgPointerSlice

type CrossPkgPointerSlice struct {
	Counts []*crosspkg.SmallCount
}

func (CrossPkgPointerSlice) MarshalBinary2

func (goo CrossPkgPointerSlice) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (CrossPkgPointerSlice) SizeBinary2

func (goo CrossPkgPointerSlice) SizeBinary2(cdc *amino.Codec) (int, error)

func (*CrossPkgPointerSlice) UnmarshalBinary2

func (goo *CrossPkgPointerSlice) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type EmbeddedSt1

type EmbeddedSt1 struct {
	PrimitivesStruct
}

func (EmbeddedSt1) MarshalBinary2

func (goo EmbeddedSt1) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (EmbeddedSt1) SizeBinary2

func (goo EmbeddedSt1) SizeBinary2(cdc *amino.Codec) (int, error)

func (*EmbeddedSt1) UnmarshalBinary2

func (goo *EmbeddedSt1) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type EmbeddedSt2

func (EmbeddedSt2) MarshalBinary2

func (goo EmbeddedSt2) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (EmbeddedSt2) SizeBinary2

func (goo EmbeddedSt2) SizeBinary2(cdc *amino.Codec) (int, error)

func (*EmbeddedSt2) UnmarshalBinary2

func (goo *EmbeddedSt2) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type EmbeddedSt3

func (EmbeddedSt3) MarshalBinary2

func (goo EmbeddedSt3) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (EmbeddedSt3) SizeBinary2

func (goo EmbeddedSt3) SizeBinary2(cdc *amino.Codec) (int, error)

func (*EmbeddedSt3) UnmarshalBinary2

func (goo *EmbeddedSt3) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type EmbeddedSt4

type EmbeddedSt4 struct {
	Foo1 int
	PrimitivesStruct
	Foo2              string
	ArraysStructField ArraysStruct
	Foo3              []byte
	SlicesStruct
	Foo4                bool
	PointersStructField PointersStruct
	Foo5                uint
}

func (EmbeddedSt4) MarshalBinary2

func (goo EmbeddedSt4) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (EmbeddedSt4) SizeBinary2

func (goo EmbeddedSt4) SizeBinary2(cdc *amino.Codec) (int, error)

func (*EmbeddedSt4) UnmarshalBinary2

func (goo *EmbeddedSt4) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type EmbeddedSt5

type EmbeddedSt5 struct {
	Foo1 int
	*PrimitivesStruct
	Foo2              string
	ArraysStructField *ArraysStruct
	Foo3              []byte
	*SlicesStruct
	Foo4                bool
	PointersStructField *PointersStruct
	Foo5                uint
}

func (EmbeddedSt5) MarshalBinary2

func (goo EmbeddedSt5) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (EmbeddedSt5) SizeBinary2

func (goo EmbeddedSt5) SizeBinary2(cdc *amino.Codec) (int, error)

func (*EmbeddedSt5) UnmarshalBinary2

func (goo *EmbeddedSt5) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type EmptyReprOnZero

type EmptyReprOnZero struct {
	Val int32
}

EmptyReprOnZero: a struct AminoMarshaler whose MarshalAmino returns the empty string for the zero value and a decimal representation otherwise. Mirrors std.Coin's "zero → empty string repr" behavior but is self- contained in the tests package. Used by FuzzNilEmptyRepr and as a standalone field to exercise the gen_marshal.go zero-check branch for struct Go type + non-struct repr where the repr IS zero (the path production AminoMarshalers rarely hit).

func (EmptyReprOnZero) MarshalAmino

func (e EmptyReprOnZero) MarshalAmino() (string, error)

func (EmptyReprOnZero) MarshalBinary2

func (goo EmptyReprOnZero) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (EmptyReprOnZero) SizeBinary2

func (goo EmptyReprOnZero) SizeBinary2(cdc *amino.Codec) (int, error)

func (*EmptyReprOnZero) UnmarshalAmino

func (e *EmptyReprOnZero) UnmarshalAmino(s string) error

func (*EmptyReprOnZero) UnmarshalBinary2

func (goo *EmptyReprOnZero) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type EmptyStruct

type EmptyStruct struct{}

func (EmptyStruct) MarshalBinary2

func (goo EmptyStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (EmptyStruct) SizeBinary2

func (goo EmptyStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*EmptyStruct) UnmarshalBinary2

func (goo *EmptyStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FixedStringArrayStruct

type FixedStringArrayStruct struct {
	Names [4]string
}

FixedStringArrayStruct: a struct with a `[4]string` field — a fixed-size array of ByteLength-typed elements (decoded as unpacked-list entries). Exercises the unpacked-list-array short-input rejection rule: the generator must reject wire input that provides fewer than N entries, matching reflect (binary_decode.go:625-644).

func (FixedStringArrayStruct) MarshalBinary2

func (goo FixedStringArrayStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FixedStringArrayStruct) SizeBinary2

func (goo FixedStringArrayStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FixedStringArrayStruct) UnmarshalBinary2

func (goo *FixedStringArrayStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzBlock

type FuzzBlock struct {
	GnoVMObjectInfo
	Values []FuzzValueEntry
	Name   string
}

FuzzBlock: models Block (embedded struct + slice of nested structs) Pattern: embedded ObjectInfo + slice of struct

func (FuzzBlock) MarshalBinary2

func (goo FuzzBlock) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzBlock) SizeBinary2

func (goo FuzzBlock) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzBlock) UnmarshalBinary2

func (goo *FuzzBlock) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzContainsAminoMarshaler

type FuzzContainsAminoMarshaler struct {
	AM AminoMarshalerStruct1
}

FuzzContainsAminoMarshaler: a struct with an AminoMarshaler struct field whose repr is itself a struct. Exercises the `IsAminoMarshaler && field-type==struct && repr-type==struct` path in gen_size.go / gen_marshal.go, which are easy to get out of sync on the "should we emit the field key?" decision.

func (FuzzContainsAminoMarshaler) MarshalBinary2

func (goo FuzzContainsAminoMarshaler) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzContainsAminoMarshaler) SizeBinary2

func (goo FuzzContainsAminoMarshaler) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzContainsAminoMarshaler) UnmarshalBinary2

func (goo *FuzzContainsAminoMarshaler) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzDeclInfo

type FuzzDeclInfo struct {
	PkgPath   string
	Name      string
	ParentLoc GnoVMLocation
	Methods   []FuzzValueEntry
}

FuzzDeclInfo: models DeclaredType (nested Location + slice of structs) Pattern: nested non-embedded struct + struct slice

func (FuzzDeclInfo) MarshalBinary2

func (goo FuzzDeclInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzDeclInfo) SizeBinary2

func (goo FuzzDeclInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzDeclInfo) UnmarshalBinary2

func (goo *FuzzDeclInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzDeepNest

type FuzzDeepNest struct {
	Blocks []FuzzBlock
	Meta   GnoVMAttrs
}

FuzzDeepNest: deeply nested struct slices (3 levels) Pattern: struct containing slice of struct containing slice of struct

func (FuzzDeepNest) MarshalBinary2

func (goo FuzzDeepNest) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzDeepNest) SizeBinary2

func (goo FuzzDeepNest) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzDeepNest) UnmarshalBinary2

func (goo *FuzzDeepNest) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzFieldInfo

type FuzzFieldInfo struct {
	Name     string
	Embedded bool
	Tag      string
	Index    int
}

FuzzFieldInfo: like gnovm's FieldType but without interface Pattern: slice of these used in FuzzStructInfo

func (FuzzFieldInfo) MarshalBinary2

func (goo FuzzFieldInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzFieldInfo) SizeBinary2

func (goo FuzzFieldInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzFieldInfo) UnmarshalBinary2

func (goo *FuzzFieldInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzFileInfo

type FuzzFileInfo struct {
	GnoVMAttrs
	FileName string
	PkgName  string
	Decls    []FuzzFieldInfo
}

FuzzFileInfo: models FileNode (deeply embedded + slice of structs) Pattern: 4-level embedded struct + slice of nested structs

func (FuzzFileInfo) MarshalBinary2

func (goo FuzzFileInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzFileInfo) SizeBinary2

func (goo FuzzFileInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzFileInfo) UnmarshalBinary2

func (goo *FuzzFileInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzFixedInt

type FuzzFixedInt struct {
	I64 int  `binary:"fixed64"`
	U64 uint `binary:"fixed64"`
}

FuzzFixedInt: exercises binary:"fixed64" on bare int/uint types (not just int64/uint64). Catches marshal/unmarshal wire-format divergence. Note: binary:"fixed32" on int/uint is rejected by amino's ValidateBasic.

func (FuzzFixedInt) MarshalBinary2

func (goo FuzzFixedInt) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzFixedInt) SizeBinary2

func (goo FuzzFixedInt) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzFixedInt) UnmarshalBinary2

func (goo *FuzzFixedInt) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzFuncInfo

type FuzzFuncInfo struct {
	GnoVMObjectInfo
	IsMethod  bool
	IsClosure bool
	Name      string
	PkgPath   string
	Captures  []FuzzValueEntry
}

FuzzFuncInfo: models FuncValue (many mixed fields + slice of nested structs) Pattern: embedded struct + bool flags + string fields + struct slice

func (FuzzFuncInfo) MarshalBinary2

func (goo FuzzFuncInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzFuncInfo) SizeBinary2

func (goo FuzzFuncInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzFuncInfo) UnmarshalBinary2

func (goo *FuzzFuncInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzNilElements

type FuzzNilElements struct {
	Entries []*FuzzFieldInfo `amino:"nil_elements"`
	Poses   []*GnoVMPos      `amino:"nil_elements"`
	Name    string
}

FuzzNilElements: exercises amino:"nil_elements" on pointer-to-struct slices.

func (FuzzNilElements) MarshalBinary2

func (goo FuzzNilElements) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzNilElements) SizeBinary2

func (goo FuzzNilElements) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzNilElements) UnmarshalBinary2

func (goo *FuzzNilElements) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzNilEmptyRepr

type FuzzNilEmptyRepr struct {
	Vals []*EmptyReprOnZero `amino:"nil_elements"`
}

FuzzNilEmptyRepr: []*EmptyReprOnZero amino:"nil_elements". Under nil_elements semantics both nil and a non-nil pointer whose MarshalAmino produces "" serialize identically (zero-length element) and both decode to nil, so strict DeepEqual roundtrip is intentionally lossy for the empty-repr case. The parity invariants that still apply are (1) encoder parity, (2) size correctness, and (3) cross-decoder agreement.

func (FuzzNilEmptyRepr) MarshalBinary2

func (goo FuzzNilEmptyRepr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzNilEmptyRepr) SizeBinary2

func (goo FuzzNilEmptyRepr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzNilEmptyRepr) UnmarshalBinary2

func (goo *FuzzNilEmptyRepr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzPtrNest

type FuzzPtrNest struct {
	Entry *FuzzValueEntry
	Index int
	Name  string
}

FuzzPtrNest: models PointerValue (pointer to nested struct) Pattern: pointer to struct containing byte array + nested struct

func (FuzzPtrNest) MarshalBinary2

func (goo FuzzPtrNest) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzPtrNest) SizeBinary2

func (goo FuzzPtrNest) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzPtrNest) UnmarshalBinary2

func (goo *FuzzPtrNest) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzStructInfo

type FuzzStructInfo struct {
	PkgPath string
	Fields  []FuzzFieldInfo
}

FuzzStructInfo: models gnovm's StructType (slice of nested structs) Pattern: slice of struct fields

func (FuzzStructInfo) MarshalBinary2

func (goo FuzzStructInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzStructInfo) SizeBinary2

func (goo FuzzStructInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzStructInfo) UnmarshalBinary2

func (goo *FuzzStructInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzUnsafeFloat

type FuzzUnsafeFloat struct {
	Score  float64 `amino:"unsafe"`
	Weight float32 `amino:"unsafe"`
	Label  string
	Count  int32
}

FuzzUnsafeFloat: exercises amino:"unsafe" for float types.

func (FuzzUnsafeFloat) MarshalBinary2

func (goo FuzzUnsafeFloat) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzUnsafeFloat) SizeBinary2

func (goo FuzzUnsafeFloat) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzUnsafeFloat) UnmarshalBinary2

func (goo *FuzzUnsafeFloat) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzValueEntry

type FuzzValueEntry struct {
	N    [8]byte
	Loc  GnoVMLocation
	Kind int32
	Data []byte
}

FuzzValueEntry: like TypedValue but fuzzable (no interfaces) Pattern: byte array + nested struct + primitives

func (FuzzValueEntry) MarshalBinary2

func (goo FuzzValueEntry) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzValueEntry) SizeBinary2

func (goo FuzzValueEntry) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzValueEntry) UnmarshalBinary2

func (goo *FuzzValueEntry) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type FuzzWriteEmpty

type FuzzWriteEmpty struct {
	Name   string   `amino:"write_empty"`
	Values []int32  `amino:"write_empty"`
	Inner  GnoVMPos `amino:"write_empty"`
	Data   []byte   `amino:"write_empty"`
	Count  int64    `amino:"write_empty"`
	Flag   bool     `amino:"write_empty"`
	Normal string   // control: no write_empty
}

FuzzWriteEmpty: exercises amino:"write_empty" on various field types.

func (FuzzWriteEmpty) MarshalBinary2

func (goo FuzzWriteEmpty) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (FuzzWriteEmpty) SizeBinary2

func (goo FuzzWriteEmpty) SizeBinary2(cdc *amino.Codec) (int, error)

func (*FuzzWriteEmpty) UnmarshalBinary2

func (goo *FuzzWriteEmpty) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMAttrs

type GnoVMAttrs struct {
	GnoVMLocation
	Label string
	Line  int
}

func (GnoVMAttrs) MarshalBinary2

func (goo GnoVMAttrs) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMAttrs) SizeBinary2

func (goo GnoVMAttrs) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMAttrs) UnmarshalBinary2

func (goo *GnoVMAttrs) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMBlock

type GnoVMBlock struct {
	GnoVMObjectInfo
	Source Interface1
	Values []GnoVMTypedValue
}

func (GnoVMBlock) MarshalBinary2

func (goo GnoVMBlock) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMBlock) SizeBinary2

func (goo GnoVMBlock) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMBlock) UnmarshalBinary2

func (goo *GnoVMBlock) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMDeclaredType

type GnoVMDeclaredType struct {
	PkgPath   string
	Name      string
	ParentLoc GnoVMLocation
	Base      Interface1
	Methods   []GnoVMTypedValue
}

func (GnoVMDeclaredType) MarshalBinary2

func (goo GnoVMDeclaredType) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMDeclaredType) SizeBinary2

func (goo GnoVMDeclaredType) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMDeclaredType) UnmarshalBinary2

func (goo *GnoVMDeclaredType) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMFieldType

type GnoVMFieldType struct {
	Name     string
	Type     Interface1
	Embedded bool
	Tag      string
}

func (GnoVMFieldType) MarshalBinary2

func (goo GnoVMFieldType) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMFieldType) SizeBinary2

func (goo GnoVMFieldType) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMFieldType) UnmarshalBinary2

func (goo *GnoVMFieldType) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMFileNode

type GnoVMFileNode struct {
	GnoVMAttrs
	FileName string
	PkgName  string
	Decls    []Interface1
}

func (GnoVMFileNode) MarshalBinary2

func (goo GnoVMFileNode) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMFileNode) SizeBinary2

func (goo GnoVMFileNode) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMFileNode) UnmarshalBinary2

func (goo *GnoVMFileNode) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMFuncValue

type GnoVMFuncValue struct {
	GnoVMObjectInfo
	Type      Interface1
	IsMethod  bool
	IsClosure bool
	Name      string
	Parent    Interface1
	Captures  []GnoVMTypedValue
	PkgPath   string
}

func (GnoVMFuncValue) MarshalBinary2

func (goo GnoVMFuncValue) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMFuncValue) SizeBinary2

func (goo GnoVMFuncValue) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMFuncValue) UnmarshalBinary2

func (goo *GnoVMFuncValue) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMLocation

type GnoVMLocation struct {
	PkgPath string
	File    string
	GnoVMSpan
}

func (GnoVMLocation) MarshalBinary2

func (goo GnoVMLocation) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMLocation) SizeBinary2

func (goo GnoVMLocation) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMLocation) UnmarshalBinary2

func (goo *GnoVMLocation) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMMapEntry

type GnoVMMapEntry struct {
	Key   GnoVMTypedValue
	Value GnoVMTypedValue
}

func (GnoVMMapEntry) MarshalBinary2

func (goo GnoVMMapEntry) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMMapEntry) SizeBinary2

func (goo GnoVMMapEntry) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMMapEntry) UnmarshalBinary2

func (goo *GnoVMMapEntry) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMNode

type GnoVMNode struct {
	GnoVMAttrs
	Op    int32
	Left  Interface1
	Right Interface1
	Args  []Interface1
}

func (GnoVMNode) MarshalBinary2

func (goo GnoVMNode) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMNode) SizeBinary2

func (goo GnoVMNode) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMNode) UnmarshalBinary2

func (goo *GnoVMNode) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMObjectID

type GnoVMObjectID struct {
	PkgID   [20]byte
	NewTime uint64
}

GnoVMObjectID: models gnovm's ObjectID with amino marshaler

func (GnoVMObjectID) MarshalBinary2

func (goo GnoVMObjectID) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMObjectID) SizeBinary2

func (goo GnoVMObjectID) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMObjectID) UnmarshalBinary2

func (goo *GnoVMObjectID) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMObjectInfo

type GnoVMObjectInfo struct {
	ID      GnoVMObjectID
	Hash    [20]byte // like Hashlet
	OwnerID GnoVMObjectID
	ModTime uint64
}

func (GnoVMObjectInfo) MarshalBinary2

func (goo GnoVMObjectInfo) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMObjectInfo) SizeBinary2

func (goo GnoVMObjectInfo) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMObjectInfo) UnmarshalBinary2

func (goo *GnoVMObjectInfo) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMPointerValue

type GnoVMPointerValue struct {
	TV    *GnoVMTypedValue
	Base  Interface1
	Index int
}

func (GnoVMPointerValue) MarshalBinary2

func (goo GnoVMPointerValue) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMPointerValue) SizeBinary2

func (goo GnoVMPointerValue) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMPointerValue) UnmarshalBinary2

func (goo *GnoVMPointerValue) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMPos

type GnoVMPos struct {
	Line   int
	Column int
}

func (GnoVMPos) MarshalBinary2

func (goo GnoVMPos) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMPos) SizeBinary2

func (goo GnoVMPos) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMPos) UnmarshalBinary2

func (goo *GnoVMPos) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMRefValue

type GnoVMRefValue struct {
	ObjectID GnoVMObjectID
	Escaped  bool
	PkgPath  string
	Hash     [20]byte
}

func (GnoVMRefValue) MarshalBinary2

func (goo GnoVMRefValue) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMRefValue) SizeBinary2

func (goo GnoVMRefValue) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMRefValue) UnmarshalBinary2

func (goo *GnoVMRefValue) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMSliceValue

type GnoVMSliceValue struct {
	Base   Interface1
	Offset int
	Length int
	Maxcap int
}

func (GnoVMSliceValue) MarshalBinary2

func (goo GnoVMSliceValue) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMSliceValue) SizeBinary2

func (goo GnoVMSliceValue) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMSliceValue) UnmarshalBinary2

func (goo *GnoVMSliceValue) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMSpan

type GnoVMSpan struct {
	GnoVMPos
	End GnoVMPos
	Num int
}

func (GnoVMSpan) MarshalBinary2

func (goo GnoVMSpan) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMSpan) SizeBinary2

func (goo GnoVMSpan) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMSpan) UnmarshalBinary2

func (goo *GnoVMSpan) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMStructType

type GnoVMStructType struct {
	PkgPath string
	Fields  []GnoVMFieldType
}

func (GnoVMStructType) MarshalBinary2

func (goo GnoVMStructType) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMStructType) SizeBinary2

func (goo GnoVMStructType) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMStructType) UnmarshalBinary2

func (goo *GnoVMStructType) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type GnoVMTypedValue

type GnoVMTypedValue struct {
	T Interface1 // Type interface
	V Interface1 // Value interface
	N [8]byte    // like TypedValue.N
}

func (GnoVMTypedValue) MarshalBinary2

func (goo GnoVMTypedValue) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (GnoVMTypedValue) SizeBinary2

func (goo GnoVMTypedValue) SizeBinary2(cdc *amino.Codec) (int, error)

func (*GnoVMTypedValue) UnmarshalBinary2

func (goo *GnoVMTypedValue) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type HostRepr

type HostRepr struct {
	IP string
}

func (HostRepr) MarshalAmino

func (hr HostRepr) MarshalAmino() ([]byte, error)

func (HostRepr) MarshalBinary2

func (goo HostRepr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (HostRepr) SizeBinary2

func (goo HostRepr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*HostRepr) UnmarshalAmino

func (hr *HostRepr) UnmarshalAmino(repr []byte) error

func (*HostRepr) UnmarshalBinary2

func (goo *HostRepr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type IntAr

type IntAr [4]int

This will be encoded as message SomeName { repeated int val = 1; }

func (IntAr) MarshalBinary2

func (goo IntAr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (IntAr) SizeBinary2

func (goo IntAr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*IntAr) UnmarshalBinary2

func (goo *IntAr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type IntDef

type IntDef int

This will be encoded as message SomeName { int64 val = 1; }

func (IntDef) MarshalBinary2

func (goo IntDef) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (IntDef) SizeBinary2

func (goo IntDef) SizeBinary2(cdc *amino.Codec) (int, error)

func (*IntDef) UnmarshalBinary2

func (goo *IntDef) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type IntSl

type IntSl []int

This will be encoded as message SomeName { repeated int val = 1; }

func (IntSl) MarshalBinary2

func (goo IntSl) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (IntSl) SizeBinary2

func (goo IntSl) SizeBinary2(cdc *amino.Codec) (int, error)

func (*IntSl) UnmarshalBinary2

func (goo *IntSl) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type Interface1

type Interface1 interface {
	AssertInterface1()
}

type Interface2

type Interface2 interface {
	AssertInterface2()
}

type InterfaceFieldsStruct

type InterfaceFieldsStruct struct {
	F1 Interface1
	F2 Interface1
	F3 any
	F4 any
}

Yet another special case: Field could be a type alias (should not be wrapped).

func (*InterfaceFieldsStruct) AssertInterface1

func (*InterfaceFieldsStruct) AssertInterface1()

func (InterfaceFieldsStruct) MarshalBinary2

func (goo InterfaceFieldsStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InterfaceFieldsStruct) SizeBinary2

func (goo InterfaceFieldsStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InterfaceFieldsStruct) UnmarshalBinary2

func (goo *InterfaceFieldsStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type InterfaceHeavy

type InterfaceHeavy struct {
	Field1 Interface1
	Field2 Interface1
	Field3 Interface1
	Items  []Interface1
	Name   string
}

InterfaceHeavy: benchmarks MarshalAnyBinary2 with multiple interface fields.

func (InterfaceHeavy) MarshalBinary2

func (goo InterfaceHeavy) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (InterfaceHeavy) SizeBinary2

func (goo InterfaceHeavy) SizeBinary2(cdc *amino.Codec) (int, error)

func (*InterfaceHeavy) UnmarshalBinary2

func (goo *InterfaceHeavy) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type PointerSlicesStruct

type PointerSlicesStruct struct {
	Int8PtSl        []*int8
	Int16PtSl       []*int16
	Int32PtSl       []*int32
	Int32FixedPtSl  []*int32 `binary:"fixed32"`
	Int64PtSl       []*int64
	Int64FixedPtSl  []*int64 `binary:"fixed64"`
	IntPtSl         []*int
	BytePtSl        []*byte
	Uint8PtSl       []*uint8
	Uint16PtSl      []*uint16
	Uint32PtSl      []*uint32
	Uint32FixedPtSl []*uint32 `binary:"fixed32"`
	Uint64PtSl      []*uint64
	Uint64FixedPtSl []*uint64 `binary:"fixed64"`
	UintPtSl        []*uint
	StrPtSl         []*string
	BytesPtSl       []*[]byte
	TimePtSl        []*time.Time
	DurationPtSl    []*time.Duration
	EmptyPtSl       []*EmptyStruct
}

func (PointerSlicesStruct) MarshalBinary2

func (goo PointerSlicesStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (PointerSlicesStruct) SizeBinary2

func (goo PointerSlicesStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*PointerSlicesStruct) UnmarshalBinary2

func (goo *PointerSlicesStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type PointersStruct

type PointersStruct struct {
	Int8Pt        *int8
	Int16Pt       *int16
	Int32Pt       *int32
	Int32FixedPt  *int32 `binary:"fixed32"`
	Int64Pt       *int64
	Int64FixedPt  *int64 `binary:"fixed64"`
	IntPt         *int
	BytePt        *byte
	Uint8Pt       *uint8
	Uint16Pt      *uint16
	Uint32Pt      *uint32
	Uint32FixedPt *uint32 `binary:"fixed32"`
	Uint64Pt      *uint64
	Uint64FixedPt *uint64 `binary:"fixed64"`
	UintPt        *uint
	StrPt         *string
	BytesPt       *[]byte
	TimePt        *time.Time
	DurationPt    *time.Duration
	EmptyPt       *EmptyStruct
}

func (PointersStruct) MarshalBinary2

func (goo PointersStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (PointersStruct) SizeBinary2

func (goo PointersStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*PointersStruct) UnmarshalBinary2

func (goo *PointersStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type PrimitivesStruct

type PrimitivesStruct struct {
	Int8        int8
	Int16       int16
	Int32       int32
	Int32Fixed  int32 `binary:"fixed32"`
	Int64       int64
	Int64Fixed  int64 `binary:"fixed64"`
	Int         int
	Byte        byte
	Uint8       uint8
	Uint16      uint16
	Uint32      uint32
	Uint32Fixed uint32 `binary:"fixed32"`
	Uint64      uint64
	Uint64Fixed uint64 `binary:"fixed64"`
	Uint        uint
	Str         string
	Bytes       []byte
	Time        time.Time
	Duration    time.Duration
	Empty       EmptyStruct
}

func (PrimitivesStruct) MarshalBinary2

func (goo PrimitivesStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (PrimitivesStruct) SizeBinary2

func (goo PrimitivesStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*PrimitivesStruct) UnmarshalBinary2

func (goo *PrimitivesStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type PrimitivesStructAr

type PrimitivesStructAr [2]PrimitivesStruct

This will be encoded as message SomeName { repeated PrimitivesStruct val = 1; }

func (PrimitivesStructAr) MarshalBinary2

func (goo PrimitivesStructAr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (PrimitivesStructAr) SizeBinary2

func (goo PrimitivesStructAr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*PrimitivesStructAr) UnmarshalBinary2

func (goo *PrimitivesStructAr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type PrimitivesStructDef

type PrimitivesStructDef PrimitivesStruct

func (PrimitivesStructDef) MarshalBinary2

func (goo PrimitivesStructDef) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (PrimitivesStructDef) SizeBinary2

func (goo PrimitivesStructDef) SizeBinary2(cdc *amino.Codec) (int, error)

func (*PrimitivesStructDef) UnmarshalBinary2

func (goo *PrimitivesStructDef) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type PrimitivesStructSl

type PrimitivesStructSl []PrimitivesStruct

This will be encoded as message SomeName { repeated PrimitivesStruct val = 1; }

func (PrimitivesStructSl) MarshalBinary2

func (goo PrimitivesStructSl) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (PrimitivesStructSl) SizeBinary2

func (goo PrimitivesStructSl) SizeBinary2(cdc *amino.Codec) (int, error)

func (*PrimitivesStructSl) UnmarshalBinary2

func (goo *PrimitivesStructSl) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ReprElem2

type ReprElem2 struct {
	Key   string
	Value any
}

func (ReprElem2) MarshalBinary2

func (goo ReprElem2) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ReprElem2) SizeBinary2

func (goo ReprElem2) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ReprElem2) UnmarshalBinary2

func (goo *ReprElem2) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ReprElem7

type ReprElem7 struct {
	A int8
}

func (ReprElem7) MarshalAmino

func (re ReprElem7) MarshalAmino() (uint8, error)

func (ReprElem7) MarshalBinary2

func (goo ReprElem7) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ReprElem7) SizeBinary2

func (goo ReprElem7) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ReprElem7) UnmarshalAmino

func (re *ReprElem7) UnmarshalAmino(u uint8) error

func (*ReprElem7) UnmarshalBinary2

func (goo *ReprElem7) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ReprStruct1

type ReprStruct1 struct {
	C int64
	D int64
}

func (ReprStruct1) MarshalBinary2

func (goo ReprStruct1) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ReprStruct1) SizeBinary2

func (goo ReprStruct1) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ReprStruct1) UnmarshalBinary2

func (goo *ReprStruct1) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type ReprStruct4

type ReprStruct4 struct {
	A int32
}

type ShortArraysStruct

type ShortArraysStruct struct {
	TimeAr     [0]time.Time
	DurationAr [0]time.Duration
}

func (ShortArraysStruct) MarshalBinary2

func (goo ShortArraysStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (ShortArraysStruct) SizeBinary2

func (goo ShortArraysStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*ShortArraysStruct) UnmarshalBinary2

func (goo *ShortArraysStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SimpleAddress

type SimpleAddress [20]byte

func (SimpleAddress) MarshalAmino

func (a SimpleAddress) MarshalAmino() (string, error)

func (SimpleAddress) MarshalBinary2

func (goo SimpleAddress) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (SimpleAddress) SizeBinary2

func (goo SimpleAddress) SizeBinary2(cdc *amino.Codec) (int, error)

func (*SimpleAddress) UnmarshalAmino

func (a *SimpleAddress) UnmarshalAmino(repr string) error

func (*SimpleAddress) UnmarshalBinary2

func (goo *SimpleAddress) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SlicesSlicesStruct

type SlicesSlicesStruct struct {
	Int8SlSl        [][]int8
	Int16SlSl       [][]int16
	Int32SlSl       [][]int32
	Int32FixedSlSl  [][]int32 `binary:"fixed32"`
	Int64SlSl       [][]int64
	Int64FixedSlSl  [][]int64 `binary:"fixed64"`
	IntSlSl         [][]int
	ByteSlSl        [][]byte
	Uint8SlSl       [][]uint8
	Uint16SlSl      [][]uint16
	Uint32SlSl      [][]uint32
	Uint32FixedSlSl [][]uint32 `binary:"fixed32"`
	Uint64SlSl      [][]uint64
	Uint64FixedSlSl [][]uint64 `binary:"fixed64"`
	UintSlSl        [][]uint
	StrSlSl         [][]string
	BytesSlSl       [][][]byte
	TimeSlSl        [][]time.Time
	DurationSlSl    [][]time.Duration
	EmptySlSl       [][]EmptyStruct
}

func (SlicesSlicesStruct) MarshalBinary2

func (goo SlicesSlicesStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (SlicesSlicesStruct) SizeBinary2

func (goo SlicesSlicesStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*SlicesSlicesStruct) UnmarshalBinary2

func (goo *SlicesSlicesStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type SlicesStruct

type SlicesStruct struct {
	Int8Sl        []int8
	Int16Sl       []int16
	Int32Sl       []int32
	Int32FixedSl  []int32 `binary:"fixed32"`
	Int64Sl       []int64
	Int64FixedSl  []int64 `binary:"fixed64"`
	IntSl         []int
	ByteSl        []byte
	Uint8Sl       []uint8
	Uint16Sl      []uint16
	Uint32Sl      []uint32
	Uint32FixedSl []uint32 `binary:"fixed32"`
	Uint64Sl      []uint64
	Uint64FixedSl []uint64 `binary:"fixed64"`
	UintSl        []uint
	StrSl         []string
	BytesSl       [][]byte
	TimeSl        []time.Time
	DurationSl    []time.Duration
	EmptySl       []EmptyStruct
}

func (SlicesStruct) MarshalBinary2

func (goo SlicesStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (SlicesStruct) SizeBinary2

func (goo SlicesStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*SlicesStruct) UnmarshalBinary2

func (goo *SlicesStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type StructPtrSliceWithStringRepr

type StructPtrSliceWithStringRepr struct {
	Items []*StructWithStringRepr // no nil_elements tag
}

StructPtrSliceWithStringRepr exercises the list-element nil_elements rule for `[]*X` where X is a Go struct with non-struct (string) repr. If `ertIsStruct` were keyed off `einfo.ReprType.Type.Kind()` (string, false), the generator would silently encode nil entries as 0x00 sentinels. Correct behavior: key off `einfo.Type.Kind() == Struct` (Go kind, true) and reject nil entries without a `nil_elements` tag — matching reflect.

func (StructPtrSliceWithStringRepr) MarshalBinary2

func (goo StructPtrSliceWithStringRepr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (StructPtrSliceWithStringRepr) SizeBinary2

func (goo StructPtrSliceWithStringRepr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*StructPtrSliceWithStringRepr) UnmarshalBinary2

func (goo *StructPtrSliceWithStringRepr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type StructUint8ReprSliceStruct

type StructUint8ReprSliceStruct struct {
	Vals []ReprElem7
}

StructUint8ReprSliceStruct: exercises the unpacked-list packed-branch bare-byte (beOptionByte) emission for AminoMarshaler-struct elements whose repr is uint8. Reflect detects this via beOptionByte at binary_encode.go:165 and emits EncodeByte (1 byte). Without the generator's bare-byte handling at this site, writePrimitiveEncode would emit `PrependUvarint(buf, offset, uint64(elem))` against a struct-typed accessor — a Go compile error AND a wire divergence (uvarint of byte ≥128 is 2 bytes; reflect emits 1 bare byte).

Mirror of AminoMarshalerStruct7 (top-level repr-bytes) but at the struct-field position, where writeUnpackedListMarshal handles the list rather than writePackedSliceReprMarshal.

func (StructUint8ReprSliceStruct) MarshalBinary2

func (goo StructUint8ReprSliceStruct) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (StructUint8ReprSliceStruct) SizeBinary2

func (goo StructUint8ReprSliceStruct) SizeBinary2(cdc *amino.Codec) (int, error)

func (*StructUint8ReprSliceStruct) UnmarshalBinary2

func (goo *StructUint8ReprSliceStruct) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

type StructWithStringRepr

type StructWithStringRepr struct {
	Name string
}

StructWithStringRepr is a Go struct whose MarshalAmino returns a string. Used to exercise the "struct-pointer needs nil_elements" rule for list elements whose Go kind is Struct but repr kind is String (Typ3ByteLength, so unpacked list encoding is used). The generator must key off `einfo.Type.Kind() == Struct` (Go kind), not the repr kind — matching reflect at binary_encode.go:399.

func (StructWithStringRepr) MarshalAmino

func (s StructWithStringRepr) MarshalAmino() (string, error)

func (StructWithStringRepr) MarshalBinary2

func (goo StructWithStringRepr) MarshalBinary2(cdc *amino.Codec, buf []byte, offset int) (int, error)

func (StructWithStringRepr) SizeBinary2

func (goo StructWithStringRepr) SizeBinary2(cdc *amino.Codec) (int, error)

func (*StructWithStringRepr) UnmarshalAmino

func (s *StructWithStringRepr) UnmarshalAmino(r string) error

func (*StructWithStringRepr) UnmarshalBinary2

func (goo *StructWithStringRepr) UnmarshalBinary2(cdc *amino.Codec, bz []byte, anyDepth int) error

Directories

Path Synopsis
binary/debug command
json/debug command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL