63434f6bc9
- inject dependencies instead of initializing them in the constructor
17 lines
482 B
Go
17 lines
482 B
Go
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)
|
|
}
|