Skip to content

Commit

Permalink
CR's fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed Oct 17, 2023
1 parent 5fc7481 commit bdbe835
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions service/cachemdw/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func GetQueryKey(

parts := []string{
chainID,
req.Method,
hashedReq.Hex(),
}

Expand Down
2 changes: 1 addition & 1 deletion service/cachemdw/keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestUnitTestGetQueryKey(t *testing.T) {
Method: "eth_getBlockByHash",
Params: []interface{}{"0x1234", true},
},
expectedCacheKey: "query:chain1:0xb2b69f976d9aa41cd2065e2a2354254f6cba682a6fe2b3996571daa27ea4a6f4",
expectedCacheKey: "query:chain1:eth_getBlockByHash:0xb2b69f976d9aa41cd2065e2a2354254f6cba682a6fe2b3996571daa27ea4a6f4",
},
{
desc: "test case #1",
Expand Down
2 changes: 1 addition & 1 deletion service/cachemdw/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestE2ETestServiceCacheMiddleware(t *testing.T) {

cacheItems := inMemoryCache.GetAll(context.Background())
require.Len(t, cacheItems, 1)
require.Contains(t, cacheItems, "query:1:0x885d3d84b42d647be47d94a001428be7e88ab787251031ddbfb247a581d0505a")
require.Contains(t, cacheItems, "query:1:eth_getBlockByNumber:0x885d3d84b42d647be47d94a001428be7e88ab787251031ddbfb247a581d0505a")
})

t.Run("cache hit", func(t *testing.T) {
Expand Down

0 comments on commit bdbe835

Please sign in to comment.