utility

package
v0.0.0-...-716ec33 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(record avro.AvroRecord, buffer []byte) error

Decode tries to decode a data buffer, read it and store it on the input record. If successfully, the record is filled with data from the buffer, otherwise an error might be returned

func Encode

func Encode(record avro.AvroRecord) ([]byte, error)

Encode returns a byte slice representing the binary encoding of the input avro record

func EncodePubKey

func EncodePubKey(pubKeyConverter core.PubkeyConverter, pubKey []byte) []byte

EncodePubKey returns a byte slice of the encoded pubKey input, using a pub key converter

func GetBytes

func GetBytes(val *big.Int) []byte

GetBytes returns the bytes representation of a big int input if not nil, otherwise returns []byte{}

func HexSliceToByteSlice

func HexSliceToByteSlice(in []string) ([][]byte, error)

HexSliceToByteSlice outputs a decoded byte slice representation of a hex string encoded slice input

func MetaChainShardAddress

func MetaChainShardAddress() []byte

MetaChainShardAddress returns core.MetachainShardId as a 62 byte array address(by padding with zeros). This is needed, since all addresses from avro schema are required to be 62 fixed byte array

func UIntSliceToIntSlice

func UIntSliceToIntSlice(in []uint64) []int64

UIntSliceToIntSlice outputs the int64 slice representation of a uint64 slice input

Types

This section is empty.

Jump to

Keyboard shortcuts

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