diff --git a/erpc/evm_json_rpc_cache_test.go b/erpc/evm_json_rpc_cache_test.go index 2d7ef569..8e8ebaea 100644 --- a/erpc/evm_json_rpc_cache_test.go +++ b/erpc/evm_json_rpc_cache_test.go @@ -81,6 +81,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { mockConnector.On("Set", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) @@ -97,6 +98,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { mockConnector.On("Set", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) @@ -150,6 +152,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { mockConnector.On("Set", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil).Once() mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) @@ -170,6 +173,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { mockConnector.On("Set", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) @@ -184,6 +188,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { resp := common.NewNormalizedResponse().WithBody([]byte(`{"result":{"number":"0x399","hash":"0xdef"}}`)) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) assert.NoError(t, err) @@ -198,6 +203,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { resp := common.NewNormalizedResponse().WithBody([]byte(`{"result":"0x0"}`)) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) assert.NoError(t, err) @@ -212,6 +218,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { resp := common.NewNormalizedResponse().WithBody([]byte(`{"result":"0x0"}`)) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) assert.NoError(t, err) @@ -226,6 +233,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { resp := common.NewNormalizedResponse().WithBody([]byte(`{"result":"0x0"}`)) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) assert.NoError(t, err) @@ -240,6 +248,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { resp := common.NewNormalizedResponse().WithBody([]byte(`{"result":"0x0"}`)) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) assert.NoError(t, err) @@ -255,6 +264,7 @@ func TestEvmJsonRpcCache_Set(t *testing.T) { mockConnector.On("Set", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) err := cache.Set(context.Background(), req, resp) @@ -273,6 +283,7 @@ func TestEvmJsonRpcCache_Get(t *testing.T) { cachedResponse := `{"number":"0x1","hash":"0xabc"}` mockConnector.On("Get", mock.Anything, mock.Anything, "evm:123:1", mock.Anything).Return(cachedResponse, nil) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) resp, err := cache.Get(context.Background(), req) @@ -290,6 +301,7 @@ func TestEvmJsonRpcCache_Get(t *testing.T) { req := common.NewNormalizedRequest([]byte(`{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x32345",false],"id":1}`)) req.SetNetwork(mockNetwork) mockConnector.On("HasTTL", mock.AnythingOfType("string")).Return(false) + mockConnector.On("IsMethodIgnored", mock.AnythingOfType("string")).Return(false) resp, err := cache.Get(context.Background(), req) assert.NoError(t, err)