diff --git a/packages/vm/README.md b/packages/vm/README.md index 7fc48e561f..a50ae52130 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -75,6 +75,17 @@ docker run --rm -v "$(pwd)":/code \ && cp artifacts/floaty.wasm packages/vm/testdata/floaty_1.2.wasm ``` +The `cyberpunk_rust170.wasm` for +https://github.com/CosmWasm/cosmwasm/issues/1727 is built as follows +(non-reproducible): + +```sh +cd contracts/cyberpunk +rm -r target +RUSTFLAGS='-C link-arg=-s' cargo build --release --lib --target wasm32-unknown-unknown --locked +cp target/wasm32-unknown-unknown/release/cyberpunk.wasm ../../packages/vm/testdata/cyberpunk_rust170.wasm +``` + ## Testing By default, this repository is built and tested with the singlepass backend. You diff --git a/packages/vm/src/compatibility.rs b/packages/vm/src/compatibility.rs index 428d51554f..2c500bdb30 100644 --- a/packages/vm/src/compatibility.rs +++ b/packages/vm/src/compatibility.rs @@ -263,6 +263,7 @@ mod tests { static CONTRACT_0_14: &[u8] = include_bytes!("../testdata/hackatom_0.14.wasm"); static CONTRACT_0_15: &[u8] = include_bytes!("../testdata/hackatom_0.15.wasm"); static CONTRACT: &[u8] = include_bytes!("../testdata/hackatom.wasm"); + static CONTRACT_RUST_170: &[u8] = include_bytes!("../testdata/cyberpunk_rust170.wasm"); fn default_capabilities() -> HashSet { ["staking".to_string()].into_iter().collect() @@ -274,6 +275,12 @@ mod tests { check_wasm(CONTRACT, &default_capabilities()).unwrap(); } + #[test] + fn check_wasm_allows_sign_ext() { + // See https://github.com/CosmWasm/cosmwasm/issues/1727 + check_wasm(CONTRACT_RUST_170, &default_capabilities()).unwrap(); + } + #[test] fn check_wasm_old_contract() { match check_wasm(CONTRACT_0_15, &default_capabilities()) { diff --git a/packages/vm/testdata/cyberpunk_rust170.wasm b/packages/vm/testdata/cyberpunk_rust170.wasm new file mode 100755 index 0000000000..3bd0b471c0 Binary files /dev/null and b/packages/vm/testdata/cyberpunk_rust170.wasm differ