backend

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Used by block filter; also used for polling
	BlockNumber() (hexutil.Uint64, error)
	LatestBlockNumber() (int64, error)
	HeaderByNumber(blockNum rpctypes.BlockNumber) (*ethtypes.Header, error)
	HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error)
	GetBlockByNumber(blockNum rpctypes.BlockNumber, fullTx bool) (map[string]interface{}, error)
	GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error)

	// returns the logs of a given block
	GetLogs(blockHash common.Hash) ([][]*ethtypes.Log, error)

	// Used by pending transaction filter
	PendingTransactions() ([]*rpctypes.Transaction, error)

	// Used by log filter
	GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error)
	BloomStatus() (uint64, uint64)
}

Backend implements the functionality needed to filter changes. Implemented by EthermintBackend.

type EthermintBackend

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

EthermintBackend implements the Backend interface

func New

New creates a new EthermintBackend instance

func (*EthermintBackend) BlockNumber

func (b *EthermintBackend) BlockNumber() (hexutil.Uint64, error)

BlockNumber returns the current block number.

func (*EthermintBackend) BloomStatus

func (b *EthermintBackend) BloomStatus() (uint64, uint64)

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

func (*EthermintBackend) GetBlockByHash

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

GetBlockByHash returns the block identified by hash.

func (*EthermintBackend) GetBlockByNumber

func (b *EthermintBackend) GetBlockByNumber(blockNum rpctypes.BlockNumber, fullTx bool) (map[string]interface{}, error)

GetBlockByNumber returns the block identified by number.

func (*EthermintBackend) GetLogs

func (b *EthermintBackend) GetLogs(blockHash common.Hash) ([][]*ethtypes.Log, error)

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

func (*EthermintBackend) GetTransactionLogs

func (b *EthermintBackend) 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 (*EthermintBackend) HeaderByHash

func (b *EthermintBackend) HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error)

HeaderByHash returns the block header identified by hash.

func (*EthermintBackend) HeaderByNumber

func (b *EthermintBackend) HeaderByNumber(blockNum rpctypes.BlockNumber) (*ethtypes.Header, error)

HeaderByNumber returns the block header identified by height.

func (*EthermintBackend) LatestBlockNumber added in v0.3.2

func (b *EthermintBackend) LatestBlockNumber() (int64, error)

LatestBlockNumber gets the latest block height in int64 format.

func (*EthermintBackend) PendingTransactions

func (b *EthermintBackend) PendingTransactions() ([]*rpctypes.Transaction, 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.

Jump to

Keyboard shortcuts

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