adjust block/uncle reward tests and add methods to pkg/geth blockchain and ethclient for direct fetching of eth balances
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
|
||||
type BlockChain interface {
|
||||
ContractDataFetcher
|
||||
AccountDataFetcher
|
||||
GetBlockByNumber(blockNumber int64) (Block, error)
|
||||
GetEthLogsWithCustomQuery(query ethereum.FilterQuery) ([]types.Log, error)
|
||||
GetHeaderByNumber(blockNumber int64) (Header, error)
|
||||
@@ -39,3 +40,7 @@ type BlockChain interface {
|
||||
type ContractDataFetcher interface {
|
||||
FetchContractData(abiJSON string, address string, method string, methodArgs []interface{}, result interface{}, blockNumber int64) error
|
||||
}
|
||||
|
||||
type AccountDataFetcher interface {
|
||||
GetAccountBalance(address common.Address, blockNumber *big.Int) (*big.Int, error)
|
||||
}
|
||||
|
||||
@@ -32,4 +32,5 @@ type EthClient interface {
|
||||
HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
|
||||
TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)
|
||||
TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
|
||||
BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user