common

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressFromBech32Str

func AddressFromBech32Str(address string) (common.Address, error)

AddressFromBech32Str Creates eth address from bech32 address string

func AddressesFromBech32StrArray

func AddressesFromBech32StrArray(items []string) ([]common.Address, error)

AddressesFromBech32StrArray tries to create a slice of common.Address values from a string slice

func AddressesFromBech32StrItemArray

func AddressesFromBech32StrItemArray[T any](items []T, addressFunc func(T) string) ([]common.Address, error)

AddressesFromBech32StrItemArray tries to create a slice of common.Address values from arbitrary slice

func Bech32StrFromAddress

func Bech32StrFromAddress(address common.Address) string

Bech32StrFromAddress Creates bech32 address string from eth address

func Bech32StrFromBytes added in v0.5.4

func Bech32StrFromBytes(address []byte) string

func ClearPaginationKey

func ClearPaginationKey(pagination *query.PageRequest) *query.PageRequest

func ParseSdkEvent

func ParseSdkEvent(sdkEvent sdk.Event, fillEvent func(proto.Message)) error

Takes sdk.Event as proto msg, passes it to fillEvent. fillEvent should create typed event for caller.

Types

type EthEventProvider

type EthEventProvider func(sdk.Context, *ethcmn.Address, sdk.Event) (*ethtypes.Log, error)

EthEventProvider an event provider func definition

type EthEventsRegistry

type EthEventsRegistry struct {
	// contains filtered or unexported fields
}

EthEventsRegistry maps sdk.Event types to functions that construct and write to log corresponding eth events

func NewEthEventsRegistry

func NewEthEventsRegistry() *EthEventsRegistry

func (*EthEventsRegistry) EmitEvents

func (r *EthEventsRegistry) EmitEvents(ctx sdk.Context, stateDB vm.StateDB, address *ethcmn.Address) error

EmitEvents iterates through current transaction sdk events and writes eth event to log if sdk event registered in events registry

func (*EthEventsRegistry) RegisterEvent

func (r *EthEventsRegistry) RegisterEvent(eventType string, ethEventProvider EthEventProvider)

RegisterEvent registers a provider for eventType

type WrongArgsNumber

type WrongArgsNumber struct {
	Expected int
	Got      int
}

func (WrongArgsNumber) Error

func (e WrongArgsNumber) Error() string

Jump to

Keyboard shortcuts

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