backend

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	BlockNumber() (hexutil.Uint64, error)
	GetBlockByNumber(blockNum types.BlockNumber, fullTx bool) (map[string]interface{}, error)
	GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error)
	HeaderByNumber(blockNum types.BlockNumber) (*ethtypes.Header, error)
	HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error)
	PendingTransactions() ([]*sdk.Tx, error)
	GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error)
	GetTransactionCount(address common.Address, blockNum types.BlockNumber) (*hexutil.Uint64, error)
	SendTransaction(args types.SendTxArgs) (common.Hash, error)
	GetLogs(blockHash common.Hash) ([][]*ethtypes.Log, error)
	BloomStatus() (uint64, uint64)
	GetCoinbase() (sdk.AccAddress, error)
	EstimateGas(args evmtypes.CallArgs, blockNrOptional *types.BlockNumber) (hexutil.Uint64, error)
	RPCGasCap() uint64
}

Backend implements the functionality shared within namespaces. Implemented by EVMBackend.

type EVMBackend

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

EVMBackend implements the Backend interface

func NewEVMBackend

func NewEVMBackend(ctx *server.Context, logger log.Logger, clientCtx client.Context) *EVMBackend

NewEVMBackend creates a new EVMBackend instance

func (*EVMBackend) BlockNumber

func (e *EVMBackend) BlockNumber() (hexutil.Uint64, error)

BlockNumber returns the current block number in abci app state. Because abci app state could lag behind from tendermint latest block, it's more stable for the client to use the latest block number in abci app state than tendermint rpc.

func (*EVMBackend) BloomStatus

func (e *EVMBackend) BloomStatus() (uint64, uint64)

BloomStatus returns the BloomBitsBlocks and the number of processed sections maintained by the chain indexer.

func (*EVMBackend) EstimateGas

func (e *EVMBackend) EstimateGas(args evmtypes.CallArgs, blockNrOptional *types.BlockNumber) (hexutil.Uint64, error)

EstimateGas returns an estimate of gas usage for the given smart contract call.

func (*EVMBackend) EthBlockFromTendermint

func (e *EVMBackend) EthBlockFromTendermint(
	block *tmtypes.Block,
	fullTx bool,
) (map[string]interface{}, error)

EthBlockFromTendermint returns a JSON-RPC compatible Ethereum block from a given Tendermint block.

func (*EVMBackend) GetBlockByHash

func (e *EVMBackend) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error)

GetBlockByHash returns the block identified by hash.

func (*EVMBackend) GetBlockByNumber

func (e *EVMBackend) GetBlockByNumber(blockNum types.BlockNumber, fullTx bool) (map[string]interface{}, error)

GetBlockByNumber returns the block identified by number.

func (*EVMBackend) GetCoinbase

func (e *EVMBackend) GetCoinbase() (sdk.AccAddress, error)

GetCoinbase is the address that staking rewards will be send to (alias for Etherbase).

func (*EVMBackend) GetLogs

func (e *EVMBackend) GetLogs(blockHash common.Hash) ([][]*ethtypes.Log, error)

GetLogs returns all the logs from all the ethereum transactions in a block.

func (*EVMBackend) GetLogsByNumber

func (e *EVMBackend) GetLogsByNumber(blockNum types.BlockNumber) ([][]*ethtypes.Log, error)

func (*EVMBackend) GetTransactionCount

func (e *EVMBackend) GetTransactionCount(address common.Address, blockNum types.BlockNumber) (*hexutil.Uint64, error)

GetTransactionCount returns the number of transactions at the given address up to the given block number.

func (*EVMBackend) GetTransactionLogs

func (e *EVMBackend) GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error)

GetTransactionLogs returns the logs given a transaction hash. It returns an error if there's an encoding error. If no logs are found for the tx hash, the error is nil.

func (*EVMBackend) HeaderByHash

func (e *EVMBackend) HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error)

HeaderByHash returns the block header identified by hash.

func (*EVMBackend) HeaderByNumber

func (e *EVMBackend) HeaderByNumber(blockNum types.BlockNumber) (*ethtypes.Header, error)

HeaderByNumber returns the block header identified by height.

func (*EVMBackend) PendingTransactions

func (e *EVMBackend) PendingTransactions() ([]*sdk.Tx, error)

PendingTransactions returns the transactions that are in the transaction pool and have a from address that is one of the accounts this node manages.

func (*EVMBackend) RPCGasCap

func (e *EVMBackend) RPCGasCap() uint64

RPCGasCap is the global gas cap for eth-call variants.

func (*EVMBackend) SendTransaction

func (e *EVMBackend) SendTransaction(args types.SendTxArgs) (common.Hash, error)

Jump to

Keyboard shortcuts

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