encoding

package
v0.0.0-...-07b51e5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedItemType = errors.New("unexpected item type")
)

Functions

This section is empty.

Types

type CompactArray

type CompactArray struct {
	Length uint64
	Data   []byte
}

CompactArray models the data structure described here: A compact-array is serialized as the array length, followed by each array item. Solana requires that the length be variant encoded over 3 bytes - i.e.: [ArrLenByte1, ArrLenByte2, ArrLenByte3, arrayContentsN, arrayContentsN+1,...] Source: https://docs.solana.com/developing/programming-model/transactions#compact-array-format

func (CompactArray) ToBytes

func (c CompactArray) ToBytes() []byte

ToBytes gets the compact array as a byte array.

type Compactor

type Compactor interface {
	Compact() CompactArray
}

Compactor is the interface implemented by types that can Compact themselves into a CompactArray

Jump to

Keyboard shortcuts

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