encoded

package
v0.0.0-...-4caf2e4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// For boxes: "bx:<8 bytes><64 byte name>"
	KVRecordV6MaxKeyLength = 128

	// For boxes: MaxBoxSize
	KVRecordV6MaxValueLength = 32768

	// MaxEncodedKVDataSize is the max size of serialized KV entry, checked with TestEncodedKVDataSize.
	// Exact value is 32906 that is 10 bytes more than 32768 + 128
	MaxEncodedKVDataSize = 33000
)

Adjust these to be big enough for boxes, but not directly tied to box values.

Variables

This section is empty.

Functions

func BalanceRecordV5MaxSize

func BalanceRecordV5MaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func BalanceRecordV6MaxSize

func BalanceRecordV6MaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func KVRecordV6MaxSize

func KVRecordV6MaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

Types

type BalanceRecordV5

type BalanceRecordV5 struct {
	Address     basics.Address `codec:"pk,allocbound=crypto.DigestSize"`
	AccountData msgp.Raw       `codec:"ad"` // encoding of basics.AccountData
	// contains filtered or unexported fields
}

BalanceRecordV5 is the encoded account balance record.

func (*BalanceRecordV5) CanMarshalMsg

func (_ *BalanceRecordV5) CanMarshalMsg(z interface{}) bool

func (*BalanceRecordV5) CanUnmarshalMsg

func (_ *BalanceRecordV5) CanUnmarshalMsg(z interface{}) bool

func (*BalanceRecordV5) MarshalMsg

func (z *BalanceRecordV5) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*BalanceRecordV5) MsgIsZero

func (z *BalanceRecordV5) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*BalanceRecordV5) Msgsize

func (z *BalanceRecordV5) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BalanceRecordV5) UnmarshalMsg

func (z *BalanceRecordV5) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*BalanceRecordV5) UnmarshalMsgWithState

func (z *BalanceRecordV5) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type BalanceRecordV6

type BalanceRecordV6 struct {
	Address     basics.Address      `codec:"a,allocbound=crypto.DigestSize"`
	AccountData msgp.Raw            `codec:"b"`                                                              // encoding of baseAccountData
	Resources   map[uint64]msgp.Raw `codec:"c,allocbound=resourcesPerCatchpointFileChunkBackwardCompatible"` // map of resourcesData

	// flag indicating whether there are more records for the same account coming up
	ExpectingMoreEntries bool `codec:"e"`
	// contains filtered or unexported fields
}

BalanceRecordV6 is the encoded account balance record.

func (*BalanceRecordV6) CanMarshalMsg

func (_ *BalanceRecordV6) CanMarshalMsg(z interface{}) bool

func (*BalanceRecordV6) CanUnmarshalMsg

func (_ *BalanceRecordV6) CanUnmarshalMsg(z interface{}) bool

func (*BalanceRecordV6) MarshalMsg

func (z *BalanceRecordV6) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*BalanceRecordV6) MsgIsZero

func (z *BalanceRecordV6) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*BalanceRecordV6) Msgsize

func (z *BalanceRecordV6) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BalanceRecordV6) UnmarshalMsg

func (z *BalanceRecordV6) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*BalanceRecordV6) UnmarshalMsgWithState

func (z *BalanceRecordV6) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type KVRecordV6

type KVRecordV6 struct {
	Key   []byte `codec:"k,allocbound=KVRecordV6MaxKeyLength"`
	Value []byte `codec:"v,allocbound=KVRecordV6MaxValueLength"`
	// contains filtered or unexported fields
}

KVRecordV6 is the encoded KV record.

func (*KVRecordV6) CanMarshalMsg

func (_ *KVRecordV6) CanMarshalMsg(z interface{}) bool

func (*KVRecordV6) CanUnmarshalMsg

func (_ *KVRecordV6) CanUnmarshalMsg(z interface{}) bool

func (*KVRecordV6) MarshalMsg

func (z *KVRecordV6) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*KVRecordV6) MsgIsZero

func (z *KVRecordV6) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*KVRecordV6) Msgsize

func (z *KVRecordV6) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*KVRecordV6) UnmarshalMsg

func (z *KVRecordV6) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*KVRecordV6) UnmarshalMsgWithState

func (z *KVRecordV6) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SortUint64

type SortUint64 = basics.SortUint64

SortUint64 re-export this sort, which is implemented in basics, and being used by the msgp when encoding the resources map below.

Jump to

Keyboard shortcuts

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