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:
Ian Norden
2019-04-02 10:10:17 -05:00
parent 9030cff2bd
commit 185f4c0e93
14 changed files with 173 additions and 14 deletions
+5
View File
@@ -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)
}
+1
View File
@@ -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)
}