util

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 MarshalInt64

func MarshalInt64(input int64) string

MarshalInt64 marshals an int64 as per the Ethereum standard.

func MarshalNullableByteArray

func MarshalNullableByteArray(input []byte) string

MarshalNullableByteArray marshals a byte array as per the Ethereum standard.

func MarshalNullableUint32

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

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

StrToAddress turns a string in to an address. The string representation can be short, in which case it is treated as if it has leading 0s.

func StrToBigInt

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

StrToBigInt turns a string in to a big.Int.

func StrToByteArray

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

StrToByteArray turns a string in to a byte array.

func StrToHash

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

StrToHash turns a string in to a hash. The string representation can be short, in which case it is treated as if it has leading 0s.

func StrToRoot

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

StrToRoot turns a string in to a root. The string representation can be short, in which case it is treated as if it has leading 0s.

func StrToTime

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

StrToTime turns a string in to a time.Time.

func StrToUint32

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

StrToUint32 turns a string in to a uint32.

func StrToUint64

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