contracts: Remove wat support from test fixtures (#3588)

In order to prepare for PolkaVM support I removed the wat support from
our test fixture crate.

- Removed redundant tests (invalid module checks are already inside the
prepare module where they belong
- Converted the gas_sync tests to Rust
- Moved the start function test to the `wasm` module
This commit is contained in:
Alexander Theißen
2024-03-07 09:05:04 +08:00
committed by GitHub
parent 117a9433da
commit 4ae7398818
12 changed files with 49 additions and 283 deletions
+18
View File
@@ -3442,4 +3442,22 @@ mod tests {
runtime.read_sandbox_memory_as(&memory, 0u32).unwrap();
assert_eq!(decoded.into_inner(), data);
}
#[test]
fn run_out_of_gas_in_start_fn() {
const CODE: &str = r#"
(module
(import "env" "memory" (memory 1 1))
(start $start)
(func $start
(loop $inf (br $inf)) ;; just run out of gas
(unreachable)
)
(func (export "call"))
(func (export "deploy"))
)
"#;
let mut mock_ext = MockExt::default();
assert_err!(execute(&CODE, vec![], &mut mock_ext), <Error<Test>>::OutOfGas);
}
}