util

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 11 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 MarshalInt64 added in v0.8.1

func MarshalInt64(input int64) string

MarshalInt64 marshals an int64 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 RLPAddress added in v0.5.0

func RLPAddress(buf io.Writer, input types.Address)

RLPAddress appends the RLP encoding of an address to the buffer.

func RLPBytes added in v0.5.0

func RLPBytes(buf io.Writer, input []byte)

RLPBytes appends the RLP encoding of the input to the buffer.

func RLPList added in v0.5.0

func RLPList(buf io.Writer, items []byte)

RLPList appends the RLP encoding of a list of items to the buffer.

func RLPNil added in v0.5.0

func RLPNil(buf io.Writer)

RLPNil appends the RLP encoding of nil to the buffer.

func RLPUint64 added in v0.5.0

func RLPUint64(buf io.Writer, input uint64)

RLPUint64 appends the RLP encoding of the input to the buffer.

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

type Subscription added in v0.6.0

type Subscription struct {
	ID []byte
}

Subscription contains a subscription.

Jump to

Keyboard shortcuts

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