Skip to content

Commit

Permalink
Merge pull request #310 from CosmWasm/update-contracts
Browse files Browse the repository at this point in the history
Recompile all three contracts and store in vm/testdata
  • Loading branch information
webmaster128 authored Apr 30, 2020
2 parents 71f643f + 7862b13 commit 520bfe6
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

# Build results
target/
contracts/**/contract.wasm
contracts/**/hash.txt
# this is moved to vm/testdata, others are present locally
contracts/hackatom/contract.wasm
contracts/hackatom/hash.txt

# IDEs
.vscode/
Expand Down
Binary file added contracts/queue/contract.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions contracts/queue/hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
96b68e218310915be79f8e4e71a2b5551f68f081b689f258874af2c292c5d1fb contract.wasm
Binary file added contracts/reflect/contract.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions contracts/reflect/hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15bcaa70904c797674e1429e3544ed4303c0f1e647b63cd08d27d0653a8d9e45 contract.wasm
4 changes: 4 additions & 0 deletions packages/vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ docker run --rm -v "$(pwd)":/code \
cp contracts/hackatom/contract.wasm packages/vm/testdata/contract_0.8.wasm
```

You can do the same for `reflect` and `queue` when there are breaking changes.
Those are not used internally for testing, but provided here for use testing
other projects, like `go-cosmwasm`.

## Testing

By default, this repository is built and tested with the singlepass backend.
Expand Down
6 changes: 3 additions & 3 deletions packages/vm/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ mod singlepass_test {

let init_used = orig_gas - instance.get_gas();
println!("init used: {}", init_used);
assert_eq!(init_used, 45607);
assert_eq!(init_used, 45568);
}

#[test]
Expand All @@ -417,7 +417,7 @@ mod singlepass_test {

let handle_used = gas_before_handle - instance.get_gas();
println!("handle used: {}", handle_used);
assert_eq!(handle_used, 63367);
assert_eq!(handle_used, 63432);
}

#[test]
Expand Down Expand Up @@ -452,6 +452,6 @@ mod singlepass_test {

let query_used = gas_before_query - instance.get_gas();
println!("query used: {}", query_used);
assert_eq!(query_used, 23018);
assert_eq!(query_used, 23066);
}
}
Binary file modified packages/vm/testdata/contract_0.8.wasm
Binary file not shown.

0 comments on commit 520bfe6

Please sign in to comment.