Skip to content

Commit 5349bbc

Browse files
committed
Fix tests
1 parent 415702e commit 5349bbc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

contracts/hackatom/tests/integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ fn execute_allocate_large_memory() {
435435
// Gas consumption is relatively small
436436
// Note: the exact gas usage depends on the Rust version used to compile Wasm,
437437
// which we only fix when using rust-optimizer, not integration tests.
438-
let expected = 9553320; // +/- 20%
438+
let expected = 12162675; // +/- 20%
439439
assert!(gas_used > expected * 80 / 100, "Gas used: {gas_used}");
440440
assert!(gas_used < expected * 120 / 100, "Gas used: {gas_used}");
441441
let used = deps.memory_pages();

packages/vm/src/instance.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ mod tests {
752752

753753
#[test]
754754
fn write_and_read_memory_works() {
755-
let mut instance = mock_instance(CONTRACT, &[]);
755+
let mut instance = mock_instance_with_gas_limit(CONTRACT, 6_000_000_000);
756756

757757
let sizes: Vec<usize> = vec![
758758
0,
@@ -763,7 +763,7 @@ mod tests {
763763
40 * KIB,
764764
400 * KIB,
765765
4 * MIB,
766-
// disabled for performance reasons, but pass as well
766+
// disabled for performance reasons, but pass as well (with much more gas)
767767
// 40 * MIB,
768768
// 400 * MIB,
769769
];
@@ -914,7 +914,7 @@ mod tests {
914914

915915
let report2 = instance.create_gas_report();
916916
assert_eq!(report2.used_externally, 251);
917-
assert_eq!(report2.used_internally, 22963110);
917+
assert_eq!(report2.used_internally, 23938680);
918918
assert_eq!(report2.limit, LIMIT);
919919
assert_eq!(
920920
report2.remaining,
@@ -1106,7 +1106,7 @@ mod tests {
11061106
.unwrap();
11071107

11081108
let init_used = orig_gas - instance.get_gas_left();
1109-
assert_eq!(init_used, 22963361);
1109+
assert_eq!(init_used, 23938931);
11101110
}
11111111

11121112
#[test]
@@ -1131,7 +1131,7 @@ mod tests {
11311131
.unwrap();
11321132

11331133
let execute_used = gas_before_execute - instance.get_gas_left();
1134-
assert_eq!(execute_used, 27661681);
1134+
assert_eq!(execute_used, 29167931);
11351135
}
11361136

11371137
#[test]
@@ -1174,6 +1174,6 @@ mod tests {
11741174
);
11751175

11761176
let query_used = gas_before_query - instance.get_gas_left();
1177-
assert_eq!(query_used, 16370691);
1177+
assert_eq!(query_used, 17327451);
11781178
}
11791179
}

0 commit comments

Comments
 (0)