Commit 0e68f6a3 authored by Hamdi Allam's avatar Hamdi Allam

test fix

parent 950bfeb5
...@@ -3,13 +3,14 @@ package node ...@@ -3,13 +3,14 @@ package node
import ( import (
"math/big" "math/big"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/rpc"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
) )
var _ EthClient = &MockEthClient{}
type MockEthClient struct { type MockEthClient struct {
mock.Mock mock.Mock
} }
...@@ -39,17 +40,7 @@ func (m *MockEthClient) StorageHash(address common.Address, blockNumber *big.Int ...@@ -39,17 +40,7 @@ func (m *MockEthClient) StorageHash(address common.Address, blockNumber *big.Int
return args.Get(0).(common.Hash), args.Error(1) return args.Get(0).(common.Hash), args.Error(1)
} }
func (m *MockEthClient) GethRpcClient() *rpc.Client { func (m *MockEthClient) FilterLogs(query ethereum.FilterQuery) ([]types.Log, error) {
args := m.Called() args := m.Called(query)
return args.Get(0).(*rpc.Client) return args.Get(0).([]types.Log), args.Error(1)
}
func (m *MockEthClient) GethEthClient() *ethclient.Client {
args := m.Called()
client, ok := args.Get(0).(*ethclient.Client)
if !ok {
return nil
}
return client
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment