util

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalAddress added in v0.2.3

func MarshalAddress(input []byte) string

MarshalAddress marshals an address as per the Ethereum standard.

func MarshalBigInt

func MarshalBigInt(input *big.Int) string

MarshalBigInt marshals a big.Int as per the Ethereum standard.

func MarshalByteArray

func MarshalByteArray(input []byte) string

MarshalByteArray marshals a byte array as per the Ethereum standard.

func MarshalNullableAddress added in v0.2.3

func MarshalNullableAddress(input []byte) string

MarshalNullableAddress marshals an address as per the Ethereum standard.

func MarshalNullableByteArray

func MarshalNullableByteArray(input []byte) string

MarshalNullableByteArray marshals a byte array as per the Ethereum standard.

func MarshalNullableUint32 added in v0.2.0

func MarshalNullableUint32(input uint32) string

MarshalNullableUint32 marshals a uint32 as per the Ethereum standard, with 0 as null.

func MarshalUint32

func MarshalUint32(input uint32) string

MarshalUint32 marshals a uint32 as per the Ethereum standard.

func MarshalUint64

func MarshalUint64(input uint64) string

MarshalUint64 marshals a uint64 as per the Ethereum standard.

func PreUnmarshalHexString

func PreUnmarshalHexString(input string) string

PreUnmarshalHexString tidies up an input hex string, removing any leading '0x' and ensuring that the input has an even number of hex digits.

func StrToAddress added in v0.4.0

func StrToAddress(name string, input string) (types.Address, error)

StrToAddress turns a string in to an address.

func StrToBigInt added in v0.4.0

func StrToBigInt(name string, input string) (*big.Int, error)

StrToBigInt turns a string in to a big.Int.

func StrToByteArray added in v0.4.0

func StrToByteArray(name string, input string) ([]byte, error)

StrToByteArray turns a string in to a byte array.

func StrToHash added in v0.4.0

func StrToHash(name string, input string) (types.Hash, error)

StrToHash turns a string in to a hash.

func StrToRoot added in v0.4.0

func StrToRoot(name string, input string) (types.Root, error)

StrToRoot turns a string in to a root.

func StrToTime added in v0.4.0

func StrToTime(name string, input string) (time.Time, error)

StrToTime turns a string in to a time.Time.

func StrToUint32 added in v0.4.0

func StrToUint32(name string, input string) (uint32, error)

StrToUint32 turns a string in to a uint32.

func StrToUint64 added in v0.4.0

func StrToUint64(name string, input string) (uint64, error)

StrToUint64 turns a string in to a uint64.

Types

This section is empty.

Jump to

Keyboard shortcuts

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