Documentation
¶
Index ¶
- Variables
- func Compare(expected types.Log, actual types.Log) ([]error, bool)
- func NewLog(hash common.Hash, blockNum uint64, address common.Address, ...) types.Log
- type AccountResult
- type Block
- type BlockNumber
- type BlockWithTxHashes
- type CallResult
- type CallTrace
- type CommonResponse
- type DebugAccountAt
- type ETHEstimateGas
- type EthError
- type EthGetTransactionCount
- type EthTxPool
- type NopRequestGenerator
- func (n NopRequestGenerator) AdminNodeInfo() (p2p.NodeInfo, error)
- func (n NopRequestGenerator) BlockNumber() (uint64, error)
- func (n NopRequestGenerator) Call(args ethapi.CallArgs, blockRef rpc.BlockReference, ...) ([]byte, error)
- func (n NopRequestGenerator) DebugAccountAt(blockHash libcommon.Hash, txIndex uint64, account libcommon.Address) (*AccountResult, error)
- func (n NopRequestGenerator) EstimateGas(args ethereum.CallMsg, blockNum BlockNumber) (uint64, error)
- func (n NopRequestGenerator) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (n NopRequestGenerator) GasPrice() (*big.Int, error)
- func (n NopRequestGenerator) GetBalance(address libcommon.Address, blockRef rpc.BlockReference) (*big.Int, error)
- func (n NopRequestGenerator) GetBlockByNumber(ctx context.Context, blockNum rpc.BlockNumber, withTxs bool) (*Block, error)
- func (n NopRequestGenerator) GetCode(address libcommon.Address, blockRef rpc.BlockReference) (hexutil.Bytes, error)
- func (n NopRequestGenerator) GetRootHash(ctx context.Context, startBlock uint64, endBlock uint64) (libcommon.Hash, error)
- func (n NopRequestGenerator) GetTransactionByHash(hash libcommon.Hash) (*ethapi.RPCTransaction, error)
- func (n NopRequestGenerator) GetTransactionCount(address libcommon.Address, blockRef rpc.BlockReference) (*big.Int, error)
- func (n NopRequestGenerator) GetTransactionReceipt(ctx context.Context, hash libcommon.Hash) (*types.Receipt, error)
- func (n NopRequestGenerator) PingErigonRpc() PingResult
- func (n NopRequestGenerator) SendTransaction(signedTx types.Transaction) (libcommon.Hash, error)
- func (n NopRequestGenerator) Subscribe(ctx context.Context, method SubMethod, subChan interface{}, ...) (ethereum.Subscription, error)
- func (n NopRequestGenerator) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (n NopRequestGenerator) TraceCall(blockRef rpc.BlockReference, args ethapi.CallArgs, traceOpts ...TraceOpt) (*TraceCallResult, error)
- func (n NopRequestGenerator) TraceTransaction(hash libcommon.Hash) ([]TransactionTrace, error)
- func (n NopRequestGenerator) TxpoolContent() (int, int, int, error)
- type PingResult
- type RPCMethod
- type RequestGenerator
- type StorageResult
- type SubMethod
- type TraceCall
- type TraceCallAction
- type TraceCallResult
- type TraceCallStateDiff
- type TraceCallStateDiffStorage
- type TraceOpt
- type TransactionTrace
Constants ¶
This section is empty.
Variables ¶
View Source
var BlockNumbers = struct { // Latest is the parameter for the latest block Latest BlockNumber // Earliest is the parameter for the earliest block Earliest BlockNumber // Pending is the parameter for the pending block Pending BlockNumber }{ Latest: "latest", Earliest: "earliest", Pending: "pending", }
View Source
var ( // ErrBadRequest for http bad requests ErrBadRequest = errors.New("bad request") )
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var Methods = struct { // ETHGetTransactionCount represents the eth_getTransactionCount method ETHGetTransactionCount RPCMethod // ETHGetBalance represents the eth_getBalance method ETHGetBalance RPCMethod // ETHSendRawTransaction represents the eth_sendRawTransaction method ETHSendRawTransaction RPCMethod // ETHGetBlockByNumber represents the eth_getBlockByNumber method ETHGetBlockByNumber RPCMethod // ETHGetBlock represents the eth_getBlock method ETHGetBlock RPCMethod // ETHGetLogs represents the eth_getLogs method ETHGetLogs RPCMethod // ETHBlockNumber represents the eth_blockNumber method ETHBlockNumber RPCMethod // AdminNodeInfo represents the admin_nodeInfo method AdminNodeInfo RPCMethod // TxpoolContent represents the txpool_content method TxpoolContent RPCMethod // OTSGetBlockDetails represents the ots_getBlockDetails method OTSGetBlockDetails RPCMethod // ETHNewHeads represents the eth_newHeads sub method ETHNewHeads SubMethod ETHLogs SubMethod TraceCall RPCMethod TraceTransaction RPCMethod DebugAccountAt RPCMethod ETHGetCode RPCMethod ETHEstimateGas RPCMethod ETHGasPrice RPCMethod ETHGetTransactionByHash RPCMethod ETHGetTransactionReceipt RPCMethod BorGetRootHash RPCMethod ETHCall RPCMethod }{ ETHGetTransactionCount: "eth_getTransactionCount", ETHGetBalance: "eth_getBalance", ETHSendRawTransaction: "eth_sendRawTransaction", ETHGetBlockByNumber: "eth_getBlockByNumber", ETHGetBlock: "eth_getBlock", ETHGetLogs: "eth_getLogs", ETHBlockNumber: "eth_blockNumber", AdminNodeInfo: "admin_nodeInfo", TxpoolContent: "txpool_content", OTSGetBlockDetails: "ots_getBlockDetails", ETHNewHeads: "eth_newHeads", ETHLogs: "eth_logs", TraceCall: "trace_call", TraceTransaction: "trace_transaction", DebugAccountAt: "debug_accountAt", ETHGetCode: "eth_getCode", ETHEstimateGas: "eth_estimateGas", ETHGasPrice: "eth_gasPrice", ETHGetTransactionByHash: "eth_getTransactionByHash", ETHGetTransactionReceipt: "eth_getTransactionReceipt", BorGetRootHash: "bor_getRootHash", ETHCall: "eth_call", }
View Source
var TraceOpts = struct { VmTrace TraceOpt Trace TraceOpt StateDiff TraceOpt }{ VmTrace: "vmTrace", Trace: "trace", StateDiff: "stateDiff", }
Functions ¶
Types ¶
type AccountResult ¶
type AccountResult struct { Address libcommon.Address `json:"address"` AccountProof []string `json:"accountProof"` Balance *hexutil.Big `json:"balance"` CodeHash libcommon.Hash `json:"codeHash"` Code hexutil.Bytes `json:"code"` Nonce hexutil.Uint64 `json:"nonce"` StorageHash libcommon.Hash `json:"storageHash"` StorageProof []StorageResult `json:"storageProof"` }
AccountResult is the result struct for GetProof
type Block ¶
type Block struct { BlockWithTxHashes Transactions []*ethapi.RPCTransaction `json:"transactions"` }
func (*Block) UnmarshalJSON ¶
type BlockNumber ¶
type BlockNumber string
func AsBlockNumber ¶
func AsBlockNumber(n *big.Int) BlockNumber
func (BlockNumber) Uint64 ¶
func (bn BlockNumber) Uint64() uint64
type BlockWithTxHashes ¶
type BlockWithTxHashes struct { *types.Header Hash libcommon.Hash `json:"hash"` TransactionHashes []libcommon.Hash }
func (*BlockWithTxHashes) UnmarshalJSON ¶
func (b *BlockWithTxHashes) UnmarshalJSON(input []byte) error
type CallResult ¶
type CallTrace ¶
type CallTrace struct { Type string `json:"type"` Action TraceCallAction `json:"action"` Result *CallResult `json:"result"` Subtraces int `json:"subtraces"` TraceAddress []int `json:"traceAddress"` Error string `json:"error"` }
type CommonResponse ¶
type DebugAccountAt ¶
type DebugAccountAt struct { CommonResponse Result AccountResult `json:"result"` }
type ETHEstimateGas ¶
type ETHEstimateGas struct { CommonResponse Number hexutil.Uint64 `json:"result"` }
type EthGetTransactionCount ¶
type EthGetTransactionCount struct { CommonResponse Result hexutil2.Uint64 `json:"result"` }
type EthTxPool ¶
type EthTxPool struct { CommonResponse Result interface{} `json:"result"` }
type NopRequestGenerator ¶
type NopRequestGenerator struct { }
func (NopRequestGenerator) AdminNodeInfo ¶
func (n NopRequestGenerator) AdminNodeInfo() (p2p.NodeInfo, error)
func (NopRequestGenerator) BlockNumber ¶
func (n NopRequestGenerator) BlockNumber() (uint64, error)
func (NopRequestGenerator) Call ¶
func (n NopRequestGenerator) Call(args ethapi.CallArgs, blockRef rpc.BlockReference, overrides *ethapi.StateOverrides) ([]byte, error)
func (NopRequestGenerator) DebugAccountAt ¶
func (n NopRequestGenerator) DebugAccountAt(blockHash libcommon.Hash, txIndex uint64, account libcommon.Address) (*AccountResult, error)
func (NopRequestGenerator) EstimateGas ¶
func (n NopRequestGenerator) EstimateGas(args ethereum.CallMsg, blockNum BlockNumber) (uint64, error)
func (NopRequestGenerator) FilterLogs ¶
func (n NopRequestGenerator) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
func (NopRequestGenerator) GetBalance ¶
func (n NopRequestGenerator) GetBalance(address libcommon.Address, blockRef rpc.BlockReference) (*big.Int, error)
func (NopRequestGenerator) GetBlockByNumber ¶
func (n NopRequestGenerator) GetBlockByNumber(ctx context.Context, blockNum rpc.BlockNumber, withTxs bool) (*Block, error)
func (NopRequestGenerator) GetCode ¶
func (n NopRequestGenerator) GetCode(address libcommon.Address, blockRef rpc.BlockReference) (hexutil.Bytes, error)
func (NopRequestGenerator) GetRootHash ¶
func (NopRequestGenerator) GetTransactionByHash ¶
func (n NopRequestGenerator) GetTransactionByHash(hash libcommon.Hash) (*ethapi.RPCTransaction, error)
func (NopRequestGenerator) GetTransactionCount ¶
func (n NopRequestGenerator) GetTransactionCount(address libcommon.Address, blockRef rpc.BlockReference) (*big.Int, error)
func (NopRequestGenerator) GetTransactionReceipt ¶
func (NopRequestGenerator) PingErigonRpc ¶
func (n NopRequestGenerator) PingErigonRpc() PingResult
func (NopRequestGenerator) SendTransaction ¶
func (n NopRequestGenerator) SendTransaction(signedTx types.Transaction) (libcommon.Hash, error)
func (NopRequestGenerator) Subscribe ¶
func (n NopRequestGenerator) Subscribe(ctx context.Context, method SubMethod, subChan interface{}, args ...interface{}) (ethereum.Subscription, error)
func (NopRequestGenerator) SubscribeFilterLogs ¶
func (n NopRequestGenerator) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
func (NopRequestGenerator) TraceCall ¶
func (n NopRequestGenerator) TraceCall(blockRef rpc.BlockReference, args ethapi.CallArgs, traceOpts ...TraceOpt) (*TraceCallResult, error)
func (NopRequestGenerator) TraceTransaction ¶
func (n NopRequestGenerator) TraceTransaction(hash libcommon.Hash) ([]TransactionTrace, error)
func (NopRequestGenerator) TxpoolContent ¶
func (n NopRequestGenerator) TxpoolContent() (int, int, int, error)
type PingResult ¶
type PingResult callResult
type RequestGenerator ¶
type RequestGenerator interface { PingErigonRpc() PingResult GetBalance(address libcommon.Address, blockRef rpc.BlockReference) (*big.Int, error) AdminNodeInfo() (p2p.NodeInfo, error) GetBlockByNumber(ctx context.Context, blockNum rpc.BlockNumber, withTxs bool) (*Block, error) GetTransactionByHash(hash libcommon.Hash) (*ethapi.RPCTransaction, error) GetTransactionReceipt(ctx context.Context, hash libcommon.Hash) (*types.Receipt, error) TraceTransaction(hash libcommon.Hash) ([]TransactionTrace, error) GetTransactionCount(address libcommon.Address, blockRef rpc.BlockReference) (*big.Int, error) BlockNumber() (uint64, error) SendTransaction(signedTx types.Transaction) (libcommon.Hash, error) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) Subscribe(ctx context.Context, method SubMethod, subChan interface{}, args ...interface{}) (ethereum.Subscription, error) TxpoolContent() (int, int, int, error) Call(args ethapi.CallArgs, blockRef rpc.BlockReference, overrides *ethapi.StateOverrides) ([]byte, error) TraceCall(blockRef rpc.BlockReference, args ethapi.CallArgs, traceOpts ...TraceOpt) (*TraceCallResult, error) DebugAccountAt(blockHash libcommon.Hash, txIndex uint64, account libcommon.Address) (*AccountResult, error) GetCode(address libcommon.Address, blockRef rpc.BlockReference) (hexutil.Bytes, error) EstimateGas(args ethereum.CallMsg, blockNum BlockNumber) (uint64, error) GasPrice() (*big.Int, error) GetRootHash(ctx context.Context, startBlock uint64, endBlock uint64) (libcommon.Hash, error) }
func NewRequestGenerator ¶
func NewRequestGenerator(target string, logger log.Logger) RequestGenerator
type StorageResult ¶
type TraceCall ¶
type TraceCall struct { CommonResponse Result TraceCallResult `json:"result"` }
type TraceCallAction ¶
type TraceCallAction struct { From common.Address `json:"from"` To common.Address `json:"to"` Address common.Address `json:"address"` RefundAddress common.Address `json:"refundAddress"` Gas hexutil.Big `json:"gas"` Value hexutil.Big `json:"value"` Balance hexutil.Big `json:"balance"` Init hexutil.Bytes `json:"init"` Input hexutil.Bytes `json:"input"` CallType string `json:"callType"` }
TraceCallAction is superset of all possible action types
type TraceCallResult ¶
type TraceCallStateDiff ¶
type TraceCallStateDiff struct { Balance interface{} `json:"balance"` Nonce interface{} `json:"nonce"` Code interface{} `json:"code"` Storage map[common.Hash]map[string]TraceCallStateDiffStorage `json:"storage"` }
type TransactionTrace ¶
type TransactionTrace struct { Type string `json:"type"` Action TraceCallAction `json:"action"` Result *CallResult `json:"result"` Error string `json:"error"` BlockHash common.Hash `json:"blockHash"` BlockNumber uint64 `json:"blockNumber"` TransactionHash common.Hash `json:"transactionHash"` TransactionPosition uint64 `json:"transactionPosition"` Subtraces int `json:"subtraces"` TraceAddress []int `json:"traceAddress"` }
Click to show internal directories.
Click to hide internal directories.