Skip to content

Commit

Permalink
TMP Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed Oct 10, 2023
1 parent 54864d4 commit fdfb514
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions service/cachemdw/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const (
)

var (
defaultChainID = big.NewInt(1)
defaultChainID = big.NewInt(1)
defaultQueryResp = []byte("resp")
)

type MockEVMClient struct{}
Expand Down Expand Up @@ -83,12 +84,12 @@ func TestUnitTestCacheQueryResponse(t *testing.T) {
require.Equal(t, cache.ErrNotFound, err)
require.Empty(t, resp)

err = serviceCache.CacheQueryResponse(context.Background(), req, defaultChainIDString, []byte("resp"))
err = serviceCache.CacheQueryResponse(context.Background(), req, defaultChainIDString, defaultQueryResp)
require.NoError(t, err)

resp, err = serviceCache.GetCachedQueryResponse(context.Background(), req, defaultHost)
require.NoError(t, err)
require.Equal(t, []byte("resp"), resp)
require.Equal(t, defaultQueryResp, resp)
}

func TestUnitTestValidateAndCacheQueryResponse(t *testing.T) {
Expand All @@ -106,12 +107,12 @@ func TestUnitTestValidateAndCacheQueryResponse(t *testing.T) {
require.Equal(t, cache.ErrNotFound, err)
require.Empty(t, resp)

err = serviceCache.ValidateAndCacheQueryResponse(context.Background(), req, defaultHost, []byte("resp"))
err = serviceCache.ValidateAndCacheQueryResponse(context.Background(), req, defaultHost, defaultQueryResp)
require.NoError(t, err)

resp, err = serviceCache.GetCachedQueryResponse(context.Background(), req, defaultHost)
require.NoError(t, err)
require.Equal(t, []byte("resp"), resp)
require.Equal(t, defaultQueryResp, resp)
}

func TestUnitTestGetCachedChainID(t *testing.T) {
Expand Down

0 comments on commit fdfb514

Please sign in to comment.