Skip to content

Commit ec3b4e4

Browse files
committed
Test call_migrate and call_migrate_with_info against old hackatom
1 parent 75e1301 commit ec3b4e4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/vm/src/calls.rs

Lines changed: 10 additions & 3 deletions
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"));

0 commit comments

Comments
 (0)