From 81fecd3f707c54373827e4c0ba8ac8a2e51fdad4 Mon Sep 17 00:00:00 2001 From: dkeysil Date: Tue, 21 May 2024 18:36:30 +0200 Subject: [PATCH 1/7] Add trace_call method --- domain/ethereum.go | 10 +++++++++ ethereum/client.go | 41 +++++++++++++++++++++++++++++------ ethereum/mocks/mock_client.go | 15 +++++++++++++ 3 files changed, 59 insertions(+), 7 deletions(-) diff --git a/domain/ethereum.go b/domain/ethereum.go index 24d8b8d3..5670fa26 100644 --- a/domain/ethereum.go +++ b/domain/ethereum.go @@ -289,6 +289,16 @@ type TransactionReceipt struct { TransactionIndex *string `json:"transactionIndex"` } +// TraceCallTransaction The transaction call object which contains the following fields +type TraceCallTransaction struct { + From string `json:"from"` + To string `json:"to"` + Gas *int64 `json:"gas,omitempty"` + GasPrice *int64 `json:"gasPrice,omitempty"` + Value *int64 `json:"value,omitempty"` + Data string `json:"data"` +} + // TraceAction is an element of a trace_block Trace response type TraceAction struct { From *string `json:"from"` diff --git a/ethereum/client.go b/ethereum/client.go index 4493a676..1c33334b 100644 --- a/ethereum/client.go +++ b/ethereum/client.go @@ -63,19 +63,23 @@ type Client interface { TransactionReceipt(ctx context.Context, txHash string) (*domain.TransactionReceipt, error) ChainID(ctx context.Context) (*big.Int, error) TraceBlock(ctx context.Context, number *big.Int) ([]domain.Trace, error) + TraceCall(ctx context.Context, req domain.TraceCallTransaction) ([]domain.Trace, error) GetLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) SubscribeToHead(ctx context.Context) (domain.HeaderCh, error) health.Reporter } -const blocksByNumber = "eth_getBlockByNumber" -const blocksByHash = "eth_getBlockByHash" -const blockNumber = "eth_blockNumber" -const getLogs = "eth_getLogs" -const transactionReceipt = "eth_getTransactionReceipt" -const traceBlock = "trace_block" -const chainId = "eth_chainId" +const ( + blocksByNumber = "eth_getBlockByNumber" + blocksByHash = "eth_getBlockByHash" + blockNumber = "eth_blockNumber" + getLogs = "eth_getLogs" + transactionReceipt = "eth_getTransactionReceipt" + traceBlock = "trace_block" + traceCall = "trace_call" + chainId = "eth_chainId" +) const defaultRetryInterval = time.Second * 15 @@ -242,6 +246,29 @@ func (e *streamEthClient) TraceBlock(ctx context.Context, number *big.Int) ([]do return result, err } +// TraceCall returns traced call +func (e *streamEthClient) TraceCall(ctx context.Context, req domain.TraceCallTransaction) ([]domain.Trace, error) { + name := fmt.Sprintf("%s(%v)", traceCall, req) + log.Debugf(name) + var result []domain.Trace + err := withBackoff(ctx, name, func(ctx context.Context) error { + err := e.rpcClient.CallContext(ctx, &result, traceCall, req, "trace", "latest") + if err != nil { + return err + } + if len(result) == 0 { + return ErrNotFound + } + return nil + }, RetryOptions{ + MinBackoff: pointDur(e.retryInterval), + MaxElapsedTime: pointDur(1 * time.Minute), + MaxBackoff: pointDur(e.retryInterval), + }, nil, nil) + + return result, err +} + // GetLogs returns the set of logs for a block func (e *streamEthClient) GetLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) { name := fmt.Sprintf("%s(%v)", getLogs, q) diff --git a/ethereum/mocks/mock_client.go b/ethereum/mocks/mock_client.go index a6a10ce1..ebb9b134 100644 --- a/ethereum/mocks/mock_client.go +++ b/ethereum/mocks/mock_client.go @@ -669,6 +669,21 @@ func (mr *MockClientMockRecorder) TraceBlock(ctx, number interface{}) *gomock.Ca return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TraceBlock", reflect.TypeOf((*MockClient)(nil).TraceBlock), ctx, number) } +// TraceCall mocks base method. +func (m *MockClient) TraceCall(ctx context.Context, req domain.TraceCallTransaction) ([]domain.Trace, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TraceCall", ctx, req) + ret0, _ := ret[0].([]domain.Trace) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TraceCall indicates an expected call of TraceCall. +func (mr *MockClientMockRecorder) TraceCall(ctx, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TraceCall", reflect.TypeOf((*MockClient)(nil).TraceCall), ctx, req) +} + // TransactionReceipt mocks base method. func (m *MockClient) TransactionReceipt(ctx context.Context, txHash string) (*domain.TransactionReceipt, error) { m.ctrl.T.Helper() From b88b06476a8dc0d2ec435f6046d1c2e785749ff7 Mon Sep 17 00:00:00 2001 From: dkeysil Date: Wed, 22 May 2024 19:53:20 +0200 Subject: [PATCH 2/7] Update trace_call method --- domain/ethereum.go | 7 +++++++ ethereum/client.go | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/domain/ethereum.go b/domain/ethereum.go index 5670fa26..a10e139f 100644 --- a/domain/ethereum.go +++ b/domain/ethereum.go @@ -299,6 +299,13 @@ type TraceCallTransaction struct { Data string `json:"data"` } +type TraceCallResult struct { + Trace []Trace `json:"trace"` + Output string `json:"output"` + StateDiff any `json:"stateDiff"` + VmTrace any `json:"vmTrace"` +} + // TraceAction is an element of a trace_block Trace response type TraceAction struct { From *string `json:"from"` diff --git a/ethereum/client.go b/ethereum/client.go index 1c33334b..0ea2bcb6 100644 --- a/ethereum/client.go +++ b/ethereum/client.go @@ -250,13 +250,13 @@ func (e *streamEthClient) TraceBlock(ctx context.Context, number *big.Int) ([]do func (e *streamEthClient) TraceCall(ctx context.Context, req domain.TraceCallTransaction) ([]domain.Trace, error) { name := fmt.Sprintf("%s(%v)", traceCall, req) log.Debugf(name) - var result []domain.Trace + var result domain.TraceCallResult err := withBackoff(ctx, name, func(ctx context.Context) error { - err := e.rpcClient.CallContext(ctx, &result, traceCall, req, "trace", "latest") + err := e.rpcClient.CallContext(ctx, &result, traceCall, req, []string{"trace"}, "latest") if err != nil { return err } - if len(result) == 0 { + if len(result.Trace) == 0 { return ErrNotFound } return nil @@ -266,7 +266,7 @@ func (e *streamEthClient) TraceCall(ctx context.Context, req domain.TraceCallTra MaxBackoff: pointDur(e.retryInterval), }, nil, nil) - return result, err + return result.Trace, err } // GetLogs returns the set of logs for a block From d5d219180cb880f3e2c766c74082361791b6b826 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 30 May 2024 13:56:59 +0200 Subject: [PATCH 3/7] Update trace call to custom debug trace call --- domain/ethereum.go | 11 +++-------- ethereum/client.go | 27 ++++++++++++++++----------- ethereum/mocks/mock_client.go | 30 +++++++++++++++--------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/domain/ethereum.go b/domain/ethereum.go index a10e139f..bddb9840 100644 --- a/domain/ethereum.go +++ b/domain/ethereum.go @@ -289,8 +289,8 @@ type TransactionReceipt struct { TransactionIndex *string `json:"transactionIndex"` } -// TraceCallTransaction The transaction call object which contains the following fields -type TraceCallTransaction struct { +// DebugTraceCallTransaction The transaction call object which contains the following fields +type DebugTraceCallTransaction struct { From string `json:"from"` To string `json:"to"` Gas *int64 `json:"gas,omitempty"` @@ -299,12 +299,7 @@ type TraceCallTransaction struct { Data string `json:"data"` } -type TraceCallResult struct { - Trace []Trace `json:"trace"` - Output string `json:"output"` - StateDiff any `json:"stateDiff"` - VmTrace any `json:"vmTrace"` -} +type CustomDebugTraceCallResult struct{} // TraceAction is an element of a trace_block Trace response type TraceAction struct { diff --git a/ethereum/client.go b/ethereum/client.go index 0ea2bcb6..79656b5a 100644 --- a/ethereum/client.go +++ b/ethereum/client.go @@ -63,7 +63,7 @@ type Client interface { TransactionReceipt(ctx context.Context, txHash string) (*domain.TransactionReceipt, error) ChainID(ctx context.Context) (*big.Int, error) TraceBlock(ctx context.Context, number *big.Int) ([]domain.Trace, error) - TraceCall(ctx context.Context, req domain.TraceCallTransaction) ([]domain.Trace, error) + CustomDebugTraceCall(ctx context.Context, req domain.DebugTraceCallTransaction, stateOverrides map[string]interface{}) (*domain.CustomDebugTraceCallResult, error) GetLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) SubscribeToHead(ctx context.Context) (domain.HeaderCh, error) @@ -77,7 +77,7 @@ const ( getLogs = "eth_getLogs" transactionReceipt = "eth_getTransactionReceipt" traceBlock = "trace_block" - traceCall = "trace_call" + debugTraceCall = "debug_traceCall" chainId = "eth_chainId" ) @@ -246,19 +246,24 @@ func (e *streamEthClient) TraceBlock(ctx context.Context, number *big.Int) ([]do return result, err } -// TraceCall returns traced call -func (e *streamEthClient) TraceCall(ctx context.Context, req domain.TraceCallTransaction) ([]domain.Trace, error) { - name := fmt.Sprintf("%s(%v)", traceCall, req) +// CustomDebugTraceCall returns traced call with custom js tracer +func (e *streamEthClient) CustomDebugTraceCall( + ctx context.Context, req domain.DebugTraceCallTransaction, stateOverrides map[string]interface{}, +) (*domain.CustomDebugTraceCallResult, error) { + name := fmt.Sprintf("%s(%v)", debugTraceCall, req) log.Debugf(name) - var result domain.TraceCallResult + var result domain.CustomDebugTraceCallResult + args := []interface{}{req, []string{"trace"}, "latest"} + if stateOverrides != nil { + args = append(args, stateOverrides) + } + err := withBackoff(ctx, name, func(ctx context.Context) error { - err := e.rpcClient.CallContext(ctx, &result, traceCall, req, []string{"trace"}, "latest") + err := e.rpcClient.CallContext(ctx, &result, debugTraceCall, args...) if err != nil { return err } - if len(result.Trace) == 0 { - return ErrNotFound - } + return nil }, RetryOptions{ MinBackoff: pointDur(e.retryInterval), @@ -266,7 +271,7 @@ func (e *streamEthClient) TraceCall(ctx context.Context, req domain.TraceCallTra MaxBackoff: pointDur(e.retryInterval), }, nil, nil) - return result.Trace, err + return &result, err } // GetLogs returns the set of logs for a block diff --git a/ethereum/mocks/mock_client.go b/ethereum/mocks/mock_client.go index ebb9b134..51b827e1 100644 --- a/ethereum/mocks/mock_client.go +++ b/ethereum/mocks/mock_client.go @@ -570,6 +570,21 @@ func (mr *MockClientMockRecorder) Close() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockClient)(nil).Close)) } +// CustomDebugTraceCall mocks base method. +func (m *MockClient) CustomDebugTraceCall(ctx context.Context, req domain.DebugTraceCallTransaction, stateOverrides map[string]interface{}) (*domain.CustomDebugTraceCallResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CustomDebugTraceCall", ctx, req, stateOverrides) + ret0, _ := ret[0].(*domain.CustomDebugTraceCallResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CustomDebugTraceCall indicates an expected call of CustomDebugTraceCall. +func (mr *MockClientMockRecorder) CustomDebugTraceCall(ctx, req, stateOverrides interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CustomDebugTraceCall", reflect.TypeOf((*MockClient)(nil).CustomDebugTraceCall), ctx, req, stateOverrides) +} + // GetLogs mocks base method. func (m *MockClient) GetLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) { m.ctrl.T.Helper() @@ -669,21 +684,6 @@ func (mr *MockClientMockRecorder) TraceBlock(ctx, number interface{}) *gomock.Ca return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TraceBlock", reflect.TypeOf((*MockClient)(nil).TraceBlock), ctx, number) } -// TraceCall mocks base method. -func (m *MockClient) TraceCall(ctx context.Context, req domain.TraceCallTransaction) ([]domain.Trace, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "TraceCall", ctx, req) - ret0, _ := ret[0].([]domain.Trace) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// TraceCall indicates an expected call of TraceCall. -func (mr *MockClientMockRecorder) TraceCall(ctx, req interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TraceCall", reflect.TypeOf((*MockClient)(nil).TraceCall), ctx, req) -} - // TransactionReceipt mocks base method. func (m *MockClient) TransactionReceipt(ctx context.Context, txHash string) (*domain.TransactionReceipt, error) { m.ctrl.T.Helper() From 559ceda0a15fde3f37577a399af9955ed22ed57b Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 30 May 2024 14:06:48 +0200 Subject: [PATCH 4/7] Update state override passing --- ethereum/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/client.go b/ethereum/client.go index 79656b5a..3b988d4f 100644 --- a/ethereum/client.go +++ b/ethereum/client.go @@ -255,7 +255,7 @@ func (e *streamEthClient) CustomDebugTraceCall( var result domain.CustomDebugTraceCallResult args := []interface{}{req, []string{"trace"}, "latest"} if stateOverrides != nil { - args = append(args, stateOverrides) + args = append(args, map[string]interface{}{"stateOverrides": stateOverrides}) } err := withBackoff(ctx, name, func(ctx context.Context) error { From 7ee1a3d8f6c141323e49c2db6e51bfe734a26047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20=C3=87=C4=B1dam?= Date: Mon, 17 Jun 2024 23:18:16 +0300 Subject: [PATCH 5/7] adjust debug_traceCall client method and params --- domain/ethereum.go | 17 ++++++++++++++--- ethereum/client.go | 25 +++++++++++++------------ ethereum/mocks/mock_client.go | 18 +++++++++--------- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/domain/ethereum.go b/domain/ethereum.go index bddb9840..2a3a6f03 100644 --- a/domain/ethereum.go +++ b/domain/ethereum.go @@ -289,8 +289,8 @@ type TransactionReceipt struct { TransactionIndex *string `json:"transactionIndex"` } -// DebugTraceCallTransaction The transaction call object which contains the following fields -type DebugTraceCallTransaction struct { +// TraceCallTransaction contains the fields of the to-be-simulated transaction. +type TraceCallTransaction struct { From string `json:"from"` To string `json:"to"` Gas *int64 `json:"gas,omitempty"` @@ -299,7 +299,18 @@ type DebugTraceCallTransaction struct { Data string `json:"data"` } -type CustomDebugTraceCallResult struct{} +// TraceCallConfig contains the tracer configuration to be used while simulating the transaction. +type TraceCallConfig struct { + Tracer string `json:"tracer,omitempty"` + TracerConfig *TracerConfig `json:"tracerConfig,omitempty"` + StateOverrides map[string]interface{} `json:"stateOverrides,omitempty"` +} + +// TracerConfig contains some extra tracer parameters. +type TracerConfig struct { + WithLog bool `json:"withLog,omitempty"` + OnlyTopCall bool `json:"onlyTopCall,omitempty"` +} // TraceAction is an element of a trace_block Trace response type TraceAction struct { diff --git a/ethereum/client.go b/ethereum/client.go index 3b988d4f..b6eeff4b 100644 --- a/ethereum/client.go +++ b/ethereum/client.go @@ -63,7 +63,11 @@ type Client interface { TransactionReceipt(ctx context.Context, txHash string) (*domain.TransactionReceipt, error) ChainID(ctx context.Context) (*big.Int, error) TraceBlock(ctx context.Context, number *big.Int) ([]domain.Trace, error) - CustomDebugTraceCall(ctx context.Context, req domain.DebugTraceCallTransaction, stateOverrides map[string]interface{}) (*domain.CustomDebugTraceCallResult, error) + DebugTraceCall( + ctx context.Context, req *domain.TraceCallTransaction, + block *rpc.BlockNumberOrHash, traceCallConfig domain.TraceCallConfig, + result interface{}, + ) error GetLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) SubscribeToHead(ctx context.Context) (domain.HeaderCh, error) @@ -246,17 +250,15 @@ func (e *streamEthClient) TraceBlock(ctx context.Context, number *big.Int) ([]do return result, err } -// CustomDebugTraceCall returns traced call with custom js tracer -func (e *streamEthClient) CustomDebugTraceCall( - ctx context.Context, req domain.DebugTraceCallTransaction, stateOverrides map[string]interface{}, -) (*domain.CustomDebugTraceCallResult, error) { +// DebugTraceCall returns the traces of a call. +func (e *streamEthClient) DebugTraceCall( + ctx context.Context, req *domain.TraceCallTransaction, + block *rpc.BlockNumberOrHash, traceCallConfig domain.TraceCallConfig, + result interface{}, +) error { name := fmt.Sprintf("%s(%v)", debugTraceCall, req) log.Debugf(name) - var result domain.CustomDebugTraceCallResult - args := []interface{}{req, []string{"trace"}, "latest"} - if stateOverrides != nil { - args = append(args, map[string]interface{}{"stateOverrides": stateOverrides}) - } + args := []interface{}{req, block, traceCallConfig} err := withBackoff(ctx, name, func(ctx context.Context) error { err := e.rpcClient.CallContext(ctx, &result, debugTraceCall, args...) @@ -270,8 +272,7 @@ func (e *streamEthClient) CustomDebugTraceCall( MaxElapsedTime: pointDur(1 * time.Minute), MaxBackoff: pointDur(e.retryInterval), }, nil, nil) - - return &result, err + return err } // GetLogs returns the set of logs for a block diff --git a/ethereum/mocks/mock_client.go b/ethereum/mocks/mock_client.go index 51b827e1..00867c98 100644 --- a/ethereum/mocks/mock_client.go +++ b/ethereum/mocks/mock_client.go @@ -13,6 +13,7 @@ import ( ethereum "github.com/ethereum/go-ethereum" common "github.com/ethereum/go-ethereum/common" types "github.com/ethereum/go-ethereum/core/types" + rpc "github.com/ethereum/go-ethereum/rpc" health "github.com/forta-network/forta-core-go/clients/health" domain "github.com/forta-network/forta-core-go/domain" gomock "github.com/golang/mock/gomock" @@ -570,19 +571,18 @@ func (mr *MockClientMockRecorder) Close() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockClient)(nil).Close)) } -// CustomDebugTraceCall mocks base method. -func (m *MockClient) CustomDebugTraceCall(ctx context.Context, req domain.DebugTraceCallTransaction, stateOverrides map[string]interface{}) (*domain.CustomDebugTraceCallResult, error) { +// DebugTraceCall mocks base method. +func (m *MockClient) DebugTraceCall(ctx context.Context, req *domain.TraceCallTransaction, block *rpc.BlockNumberOrHash, traceCallConfig domain.TraceCallConfig, result interface{}) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CustomDebugTraceCall", ctx, req, stateOverrides) - ret0, _ := ret[0].(*domain.CustomDebugTraceCallResult) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "DebugTraceCall", ctx, req, block, traceCallConfig, result) + ret0, _ := ret[0].(error) + return ret0 } -// CustomDebugTraceCall indicates an expected call of CustomDebugTraceCall. -func (mr *MockClientMockRecorder) CustomDebugTraceCall(ctx, req, stateOverrides interface{}) *gomock.Call { +// DebugTraceCall indicates an expected call of DebugTraceCall. +func (mr *MockClientMockRecorder) DebugTraceCall(ctx, req, block, traceCallConfig, result interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CustomDebugTraceCall", reflect.TypeOf((*MockClient)(nil).CustomDebugTraceCall), ctx, req, stateOverrides) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DebugTraceCall", reflect.TypeOf((*MockClient)(nil).DebugTraceCall), ctx, req, block, traceCallConfig, result) } // GetLogs mocks base method. From 1e94c030ce4d7cfd0e7aebbc962f84f2a0ee4536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20=C3=87=C4=B1dam?= Date: Tue, 18 Jun 2024 01:47:53 +0300 Subject: [PATCH 6/7] make block dynamic type and enforce certain types --- ethereum/client.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ethereum/client.go b/ethereum/client.go index b6eeff4b..7c66cacb 100644 --- a/ethereum/client.go +++ b/ethereum/client.go @@ -253,11 +253,19 @@ func (e *streamEthClient) TraceBlock(ctx context.Context, number *big.Int) ([]do // DebugTraceCall returns the traces of a call. func (e *streamEthClient) DebugTraceCall( ctx context.Context, req *domain.TraceCallTransaction, - block *rpc.BlockNumberOrHash, traceCallConfig domain.TraceCallConfig, + block any, traceCallConfig domain.TraceCallConfig, result interface{}, ) error { name := fmt.Sprintf("%s(%v)", debugTraceCall, req) log.Debugf(name) + + switch block.(type) { + case string: + case *rpc.BlockNumberOrHash: + default: + return errors.New("invalid block number type") + } + args := []interface{}{req, block, traceCallConfig} err := withBackoff(ctx, name, func(ctx context.Context) error { From d44d6eeafba1567fbf8a2c805edc6e08c9992753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20=C3=87=C4=B1dam?= Date: Tue, 18 Jun 2024 01:51:06 +0300 Subject: [PATCH 7/7] fix interfaces --- ethereum/client.go | 2 +- ethereum/mocks/mock_client.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ethereum/client.go b/ethereum/client.go index 7c66cacb..b31d9ab7 100644 --- a/ethereum/client.go +++ b/ethereum/client.go @@ -65,7 +65,7 @@ type Client interface { TraceBlock(ctx context.Context, number *big.Int) ([]domain.Trace, error) DebugTraceCall( ctx context.Context, req *domain.TraceCallTransaction, - block *rpc.BlockNumberOrHash, traceCallConfig domain.TraceCallConfig, + block any, traceCallConfig domain.TraceCallConfig, result interface{}, ) error GetLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) diff --git a/ethereum/mocks/mock_client.go b/ethereum/mocks/mock_client.go index 00867c98..54255c8f 100644 --- a/ethereum/mocks/mock_client.go +++ b/ethereum/mocks/mock_client.go @@ -13,7 +13,6 @@ import ( ethereum "github.com/ethereum/go-ethereum" common "github.com/ethereum/go-ethereum/common" types "github.com/ethereum/go-ethereum/core/types" - rpc "github.com/ethereum/go-ethereum/rpc" health "github.com/forta-network/forta-core-go/clients/health" domain "github.com/forta-network/forta-core-go/domain" gomock "github.com/golang/mock/gomock" @@ -572,7 +571,7 @@ func (mr *MockClientMockRecorder) Close() *gomock.Call { } // DebugTraceCall mocks base method. -func (m *MockClient) DebugTraceCall(ctx context.Context, req *domain.TraceCallTransaction, block *rpc.BlockNumberOrHash, traceCallConfig domain.TraceCallConfig, result interface{}) error { +func (m *MockClient) DebugTraceCall(ctx context.Context, req *domain.TraceCallTransaction, block any, traceCallConfig domain.TraceCallConfig, result interface{}) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DebugTraceCall", ctx, req, block, traceCallConfig, result) ret0, _ := ret[0].(error)