Skip to content

Commit

Permalink
Add migrate_version to hackatom for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed Jun 4, 2024
1 parent d176031 commit bcc1fc6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions contracts/hackatom/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub fn instantiate(
}

#[entry_point]
#[migrate_version(42)]
pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> Result<Response, HackError> {
let data = deps
.storage
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ mod tests {
E::Query
]),
required_capabilities: BTreeSet::new(),
contract_migrate_version: None,
contract_migrate_version: Some(42),
}
);

Expand Down
8 changes: 4 additions & 4 deletions packages/vm/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ mod tests {

let report2 = instance.create_gas_report();
assert_eq!(report2.used_externally, 251);
assert_eq!(report2.used_internally, 12109530);
assert_eq!(report2.used_internally, 11473730);
assert_eq!(report2.limit, LIMIT);
assert_eq!(
report2.remaining,
Expand Down Expand Up @@ -1105,7 +1105,7 @@ mod tests {
.unwrap();

let init_used = orig_gas - instance.get_gas_left();
assert_eq!(init_used, 12109781);
assert_eq!(init_used, 11473981);
}

#[test]
Expand All @@ -1130,7 +1130,7 @@ mod tests {
.unwrap();

let execute_used = gas_before_execute - instance.get_gas_left();
assert_eq!(execute_used, 12658786);
assert_eq!(execute_used, 12086566);
}

#[test]
Expand Down Expand Up @@ -1173,6 +1173,6 @@ mod tests {
);

let query_used = gas_before_query - instance.get_gas_left();
assert_eq!(query_used, 8094896);
assert_eq!(query_used, 7570446);
}
}
2 changes: 1 addition & 1 deletion packages/vm/testdata/hackatom.wasm
Binary file added packages/vm/testdata/hackatom_1.3.wasm
Binary file not shown.

0 comments on commit bcc1fc6

Please sign in to comment.