Add tests for pkg/geth/blockchain

- inject dependencies instead of initializing them in the constructor
This commit is contained in:
Rob Mulholand
2018-07-18 16:34:13 -05:00
parent 1355271011
commit 63434f6bc9
20 changed files with 538 additions and 106 deletions
+16
View File
@@ -0,0 +1,16 @@
package core
import (
"context"
"math/big"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/core/types"
)
type Client interface {
BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
}