Skip to content

Commit d9f14f8

Browse files
authored
Merge pull request #2437 from CosmWasm/migrate-with-old-hackatom
Migrate with old hackatom
2 parents d665ac9 + b0f16ae commit d9f14f8

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

packages/vm/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ docker run --rm -v "$(pwd)":/code \
5858
--mount type=volume,source="devcontract_cache_hackatom",target=/target \
5959
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
6060
cosmwasm/optimizer:0.15.0 ./contracts/hackatom \
61-
&& cp artifacts/hackatom.wasm packages/vm/testdata/hackatom_1.2.wasm
61+
&& cp artifacts/hackatom.wasm packages/vm/testdata/hackatom.wasm
6262

6363
docker run --rm -v "$(pwd)":/code \
6464
--mount type=volume,source="devcontract_cache_ibc_reflect",target=/target \

packages/vm/src/calls.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ mod tests {
791791
use sha2::{Digest, Sha256};
792792

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

920921
#[test]
921922
fn call_migrate_works() {
922-
let mut instance = mock_instance(HACKATOM, &[]);
923+
let mut instance = mock_instance(
924+
HACKATOM_1_3, // only old version of hackatom supports classic migrate signature
925+
&[],
926+
);
923927

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

950954
#[test]
951-
fn call_migrate_with_info_works() {
952-
let mut instance = mock_instance(HACKATOM, &[]);
955+
fn call_migrate_with_info_works_for_classic_migrate_signature() {
956+
let mut instance = mock_instance(
957+
HACKATOM_1_3, // we test again the old version of hackatom which did not implement the migrate info argument
958+
&[],
959+
);
953960

954961
// init
955962
let info = mock_info(&instance.api().addr_make("creator"), &coins(1000, "earth"));

packages/vm/testdata/hackatom.wasm

-1
This file was deleted.

packages/vm/testdata/hackatom.wasm

227 KB
Binary file not shown.

0 commit comments

Comments
 (0)