Skip to content

Migrate with old hackatom #2437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_hackatom",target=/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/optimizer:0.15.0 ./contracts/hackatom \
&& cp artifacts/hackatom.wasm packages/vm/testdata/hackatom_1.2.wasm
&& cp artifacts/hackatom.wasm packages/vm/testdata/hackatom.wasm

docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_cache_ibc_reflect",target=/target \
Expand Down
13 changes: 10 additions & 3 deletions packages/vm/src/calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ mod tests {
use sha2::{Digest, Sha256};

static HACKATOM: &[u8] = include_bytes!("../testdata/hackatom.wasm");
static HACKATOM_1_3: &[u8] = include_bytes!("../testdata/hackatom_1.3.wasm");
static CYBERPUNK: &[u8] = include_bytes!("../testdata/cyberpunk.wasm");
static FLOATY2: &[u8] = include_bytes!("../testdata/floaty_2.0.wasm");
static EMPTY: &[u8] = include_bytes!("../testdata/empty.wasm");
Expand Down Expand Up @@ -919,7 +920,10 @@ mod tests {

#[test]
fn call_migrate_works() {
let mut instance = mock_instance(HACKATOM, &[]);
let mut instance = mock_instance(
HACKATOM_1_3, // only old version of hackatom supports classic migrate signature
&[],
);

// init
let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth"));
Expand Down Expand Up @@ -948,8 +952,11 @@ mod tests {
}

#[test]
fn call_migrate_with_info_works() {
let mut instance = mock_instance(HACKATOM, &[]);
fn call_migrate_with_info_works_for_classic_migrate_signature() {
let mut instance = mock_instance(
HACKATOM_1_3, // we test again the old version of hackatom which did not implement the migrate info argument
&[],
);

// init
let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth"));
Expand Down
1 change: 0 additions & 1 deletion packages/vm/testdata/hackatom.wasm

This file was deleted.

Binary file added packages/vm/testdata/hackatom.wasm
Binary file not shown.
Loading