ethutils

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: Apache-2.0 Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallCheck

func CallCheck(ctx context.Context, client EthClient, from common.Address, contractAddress common.Address, contractABI abi.ABI, method string, params ...interface{}) error

Types

type BlockInfo added in v0.7.2

type BlockInfo struct {
	Hash       common.Hash    `json:"hash"`
	ParentHash common.Hash    `json:"parentHash"`
	Time       hexutil.Uint64 `json:"timestamp"`
	Number     *hexutil.Big   `json:"number"`
}

type EthClient added in v0.7.0

type EthClient interface {
	bind.ContractBackend
	ReceiptFetcher

	HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
	BlockInfoByNumber(ctx context.Context, number *big.Int) (*BlockInfo, error)
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
	TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
	PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)
	BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
}

type RPCEthClient added in v0.7.2

type RPCEthClient struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

func NewRPCEthClient added in v0.7.2

func NewRPCEthClient(url string) (*RPCEthClient, error)

func (*RPCEthClient) BlockInfoByNumber added in v0.7.2

func (r *RPCEthClient) BlockInfoByNumber(ctx context.Context, number *big.Int) (*BlockInfo, error)

type ReceiptFetcher added in v0.7.3

type ReceiptFetcher interface {
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
}

type SimulatedEthClient added in v0.7.2

type SimulatedEthClient struct {
	*backends.SimulatedBackend
}

func (*SimulatedEthClient) BlockInfoByNumber added in v0.7.2

func (r *SimulatedEthClient) BlockInfoByNumber(ctx context.Context, number *big.Int) (*BlockInfo, error)

Jump to

Keyboard shortcuts

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