rpt_backend_holder

package
v0.2.8-doc Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainAPIBackend

type ChainAPIBackend interface {
	StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber, isPrivate bool) (*state.StateDB, *types.Header, error)
	BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
	HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)
}

type ChainClient

type ChainClient struct {
	ChainAPIBackend
}

type ContractAPIbcakend

type ContractAPIbcakend interface {
	Call(ctx context.Context, args cpcapi.CallArgs, blockNr rpc.BlockNumber) (hexutil.Bytes, error)
}

type RptApiClient

type RptApiClient struct {
	ChainBackend    ChainAPIBackend
	ContractBackend ContractAPIbcakend
}

func (*RptApiClient) BalanceAt

func (cc *RptApiClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)

BalanceAt returns the wei balance of the given account. The block number can be nil, in which case the balance is taken from the latest known block.

func (*RptApiClient) BlockByNumber

func (cc *RptApiClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

BlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.

func (*RptApiClient) CallContract

func (cc *RptApiClient) CallContract(ctx context.Context, call cpchain.CallMsg, blockNumber *big.Int) ([]byte, error)

func (*RptApiClient) CodeAt

func (cc *RptApiClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)

func (*RptApiClient) EstimateGas

func (cc *RptApiClient) EstimateGas(ctx context.Context, call cpchain.CallMsg) (gas uint64, err error)

func (*RptApiClient) FilterLogs

func (cc *RptApiClient) FilterLogs(ctx context.Context, query cpchain.FilterQuery) ([]types.Log, error)

func (*RptApiClient) HeaderByNumber

func (cc *RptApiClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

HeaderByNumber returns a block header from the current canonical chain. If number is nil, the latest known header is returned.

func (*RptApiClient) NonceAt

func (cc *RptApiClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)

func (*RptApiClient) PendingCallContract

func (cc *RptApiClient) PendingCallContract(ctx context.Context, call cpchain.CallMsg) ([]byte, error)

func (*RptApiClient) PendingCodeAt

func (cc *RptApiClient) PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)

func (*RptApiClient) PendingNonceAt

func (cc *RptApiClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

func (*RptApiClient) SendTransaction

func (cc *RptApiClient) SendTransaction(ctx context.Context, tx *types.Transaction) error

func (*RptApiClient) SubscribeFilterLogs

func (cc *RptApiClient) SubscribeFilterLogs(ctx context.Context, q cpchain.FilterQuery, ch chan<- types.Log) (cpchain.Subscription, error)

func (*RptApiClient) SuggestGasPrice

func (cc *RptApiClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)

type RptBackendHolder

type RptBackendHolder struct {
	ChainBackend    ChainAPIBackend
	ContractBackend ContractAPIbcakend
}

used to hold *APIBackend

func GetApiBackendHolderInstance

func GetApiBackendHolderInstance() *RptBackendHolder

func (*RptBackendHolder) Init

func (rb *RptBackendHolder) Init(chainBackend ChainAPIBackend, contractBackend ContractAPIbcakend)

Jump to

Keyboard shortcuts

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