Skip to content

Commit

Permalink
Update testing contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Dec 16, 2021
1 parent cdd7c9a commit a3b39ce
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions api/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func TestGetMetrics(t *testing.T) {
assert.Equal(t, &types.Metrics{
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5532497,
SizeMemoryCache: 5576140,
}, metrics)

// Instantiate 2
Expand All @@ -223,7 +223,7 @@ func TestGetMetrics(t *testing.T) {
HitsMemoryCache: 1,
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5532497,
SizeMemoryCache: 5576140,
}, metrics)

// Pin
Expand All @@ -238,8 +238,8 @@ func TestGetMetrics(t *testing.T) {
HitsFsCache: 1,
ElementsPinnedMemoryCache: 1,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 5532497,
SizeMemoryCache: 5532497,
SizePinnedMemoryCache: 5576140,
SizeMemoryCache: 5576140,
}, metrics)

// Instantiate 3
Expand All @@ -256,8 +256,8 @@ func TestGetMetrics(t *testing.T) {
HitsFsCache: 1,
ElementsPinnedMemoryCache: 1,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 5532497,
SizeMemoryCache: 5532497,
SizePinnedMemoryCache: 5576140,
SizeMemoryCache: 5576140,
}, metrics)

// Unpin
Expand All @@ -274,7 +274,7 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5532497,
SizeMemoryCache: 5576140,
}, metrics)

// Instantiate 4
Expand All @@ -292,7 +292,7 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5532497,
SizeMemoryCache: 5576140,
}, metrics)
}

Expand Down Expand Up @@ -855,7 +855,7 @@ func TestQuery(t *testing.T) {
var badResp types.QueryResponse
err = json.Unmarshal(data, &badResp)
require.NoError(t, err)
require.Equal(t, "Error parsing into type hackatom::msg::QueryMsg: unknown variant `Raw`, expected one of `verifier`, `other_balance`, `recurse`", badResp.Err)
require.Contains(t, badResp.Err, "Error parsing into type hackatom::msg::QueryMsg: unknown variant `Raw`, expected one of")

// make a valid query
gasMeter3 := NewMockGasMeter(TESTING_GAS_LIMIT)
Expand Down
Binary file modified api/testdata/hackatom.wasm
Binary file not shown.
Binary file modified api/testdata/ibc_reflect.wasm
Binary file not shown.
Binary file modified api/testdata/queue.wasm
Binary file not shown.
Binary file modified api/testdata/reflect.wasm
Binary file not shown.
16 changes: 8 additions & 8 deletions lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestGetMetrics(t *testing.T) {
assert.Equal(t, &types.Metrics{
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5532497,
SizeMemoryCache: 5576140,
}, metrics)

// Instantiate 2
Expand All @@ -149,7 +149,7 @@ func TestGetMetrics(t *testing.T) {
HitsMemoryCache: 1,
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5532497,
SizeMemoryCache: 5576140,
}, metrics)

// Pin
Expand All @@ -164,8 +164,8 @@ func TestGetMetrics(t *testing.T) {
HitsFsCache: 1,
ElementsPinnedMemoryCache: 1,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 5532497,
SizeMemoryCache: 5532497,
SizePinnedMemoryCache: 5576140,
SizeMemoryCache: 5576140,
}, metrics)

// Instantiate 3
Expand All @@ -183,8 +183,8 @@ func TestGetMetrics(t *testing.T) {
HitsFsCache: 1,
ElementsPinnedMemoryCache: 1,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 5532497,
SizeMemoryCache: 5532497,
SizePinnedMemoryCache: 5576140,
SizeMemoryCache: 5576140,
}, metrics)

// Unpin
Expand All @@ -201,7 +201,7 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5532497,
SizeMemoryCache: 5576140,
}, metrics)

// Instantiate 4
Expand All @@ -220,6 +220,6 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5532497,
SizeMemoryCache: 5576140,
}, metrics)
}
2 changes: 1 addition & 1 deletion libwasmvm/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ mod tests {
misses: 0,
elements_pinned_memory_cache: 1,
elements_memory_cache: 0,
size_pinned_memory_cache: 5532497,
size_pinned_memory_cache: 5576140,
size_memory_cache: 0,
}
);
Expand Down

0 comments on commit a3b39ce

Please sign in to comment.