Skip to content

Commit

Permalink
Upgrade Cosmwasm to v1.0.0-beta6 and adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Mar 7, 2022
1 parent 2fce167 commit d110799
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 27 deletions.
16 changes: 8 additions & 8 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: 5563894,
SizeMemoryCache: 5622877,
}, metrics)

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

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

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

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

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

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: 5563894,
SizeMemoryCache: 5622877,
}, metrics)

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

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

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

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

// Instantiate 4
Expand All @@ -220,6 +220,6 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5563894,
SizeMemoryCache: 5622877,
}, metrics)
}
23 changes: 15 additions & 8 deletions libwasmvm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions libwasmvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ default = []
backtraces = []

[dependencies]
cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "ec8b568e8", features = ["staking", "stargate", "iterator"] }
cosmwasm-vm = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "ec8b568e8", features = ["staking", "stargate", "iterator"] }
cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "v1.0.0-beta6", features = ["staking", "stargate", "iterator"] }
cosmwasm-vm = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "v1.0.0-beta6", features = ["staking", "stargate", "iterator"] }
errno = "0.2"
serde_json = "1.0"
thiserror = "1.0"
Expand Down
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: 5563894,
size_pinned_memory_cache: 5622877,
size_memory_cache: 0,
}
);
Expand Down

0 comments on commit d110799

Please sign in to comment.