types

package
v0.0.0-...-2cb8fe2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculatePreV5FileHash

func CalculatePreV5FileHash(buffer *bytes.Reader, version uint32) (string, error)

func CalculateV5FileHash

func CalculateV5FileHash(buffer *bytes.Reader) (string, error)

Types

type Hash

type Hash struct {
	Stream
	BodyLength uint32
	DigestType []byte
	Hash       []byte
}

func NewHash

func NewHash(buffer *bytes.Reader) (*Hash, error)

func NewHashFromString

func NewHashFromString(hash string) (*Hash, error)

type RecordFile

type RecordFile struct {
	Hash            string
	MetadataHash    string
	TransactionsMap map[string]*hederaproto.TransactionID
}

func NewCompactRecordFile

func NewCompactRecordFile(recordFile map[string]interface{}) (*RecordFile, error)

func NewPreV5RecordFile

func NewPreV5RecordFile(buffer *bytes.Reader) (*RecordFile, error)

func NewV5RecordFile

func NewV5RecordFile(buffer *bytes.Reader) (*RecordFile, error)

skip the bytes before the start hash object to read a list of stream objects organized as follows:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Start Object Running Hash | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Record Stream Object | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Record Stream Object | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | End Object Running Hash | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Note the start object running hash and the end object running hash are of the same type HashObject and they have the same classId.

type SignatureFile

type SignatureFile struct {
	Stream
	Hash              []byte
	Signature         []byte
	Version           int
	MetadataHash      []byte
	MetadataSignature []byte
}

func NewSignatureFile

func NewSignatureFile(buffer *bytes.Reader) (*SignatureFile, error)

func NewV2SignatureFile

func NewV2SignatureFile(buffer *bytes.Reader) (*SignatureFile, error)

func NewV5SignatureFile

func NewV5SignatureFile(buffer *bytes.Reader) (*SignatureFile, error)

type StateProof

type StateProof struct {
	RecordFile     interface{}       `json:"record_file"`
	SignatureFiles map[string]string `json:"signature_files"`
	AddressBooks   []string          `json:"address_books"`
	Version        int64             `json:"version"`
}

func NewStateProof

func NewStateProof(payload []byte) (*StateProof, error)

type Stream

type Stream struct {
	ClassId      int64
	ClassVersion int32
	BodyLength   uint32
}

func NewStream

func NewStream(buffer *bytes.Reader) (*Stream, error)

func (*Stream) Header

func (s *Stream) Header() ([]byte, error)

Jump to

Keyboard shortcuts

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