utils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBlockTx

func DecodeBlockTx(data []byte, typeFilter transactions.TxType) (transactions.ContractCall, uint32, error)

DecodeBlockTx tries to deserialize the type, index and decoded value of a tx.

func EncodeBlockTx

func EncodeBlockTx(tx transactions.ContractCall, txIndex uint32) ([]byte, error)

EncodeBlockTx tries to serialize type, index and encoded value of transactions.ContractCall.

func ReadUint32

func ReadUint32(r io.Reader, v *uint32) error

ReadUint32 will read four bytes and convert them to a uint32 from the Tx byteOrder. The result is put into v.

func ReadUint64 added in v0.5.0

func ReadUint64(r io.Reader, v *uint64) error

ReadUint64 will read four bytes and convert them to a uint64 from the Tx byteOrder. The result is put into v.

func Search(n uint64, f func(uint64) (bool, error)) (uint64, error)

Search replicate sort.Search() upon uint64 type with error return.

func WriteUint32

func WriteUint32(w io.Writer, value uint32) error

WriteUint32 Tx utility to use a Tx byteOrder on internal encoding.

func WriteUint64

func WriteUint64(w io.Writer, value uint64) error

WriteUint64 Tx utility to use a common byteOrder on internal encoding.

Types

This section is empty.

Jump to

Keyboard shortcuts

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