utils

package
v0.0.0-...-b93f2df Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeMessageHash

func ComputeMessageHash(payloadType uint32, payload []byte, nonce *big.Int) (common.Hash, error)

func ConvertBigIntToUint256

func ConvertBigIntToUint256(b *big.Int) *uint256.Int

func ConvertStringToStringArray

func ConvertStringToStringArray(s string) []string

ConvertStringToStringArray takes a string with values separated by commas and returns a slice of strings

func GenerateNonce

func GenerateNonce() *big.Int

func GetBlockNumber

func GetBlockNumber(ctx context.Context, client *ethclient.Client, confirmations uint64) (uint64, error)

func GetBlocksInRange

func GetBlocksInRange(ctx context.Context, cli *ethclient.Client, start, end uint64) ([]*types.Block, error)

GetBlocksInRange gets a batch of blocks for a block range [start, end] inclusive.

func Loop

func Loop(ctx context.Context, period time.Duration, f func())

Loop Run the f func periodically.

func NowUTC

func NowUTC() time.Time

func ObjToJson

func ObjToJson(obj interface{}) string

func UnpackLog

func UnpackLog(c *abi.ABI, out interface{}, event string, log types.Log) error

UnpackLog unpacks a retrieved log into the provided output structure. @todo: add unit test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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