mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-04-25 04:27:57 +00:00
Replace wabt with rust tools (#5)
This commit is contained in:
committed by
GitHub
parent
8291876394
commit
374afe5700
@@ -351,16 +351,13 @@ mod tests {
|
||||
use parity_wasm::elements;
|
||||
|
||||
fn parse_wat(source: &str) -> elements::Module {
|
||||
elements::deserialize_buffer(&wabt::wat2wasm(source).expect("Failed to wat2wasm"))
|
||||
elements::deserialize_buffer(&wat::parse_str(source).expect("Failed to wat2wasm"))
|
||||
.expect("Failed to deserialize the module")
|
||||
}
|
||||
|
||||
fn validate_module(module: elements::Module) {
|
||||
let binary = elements::serialize(module).expect("Failed to serialize");
|
||||
wabt::Module::read_binary(&binary, &Default::default())
|
||||
.expect("Wabt failed to read final binary")
|
||||
.validate()
|
||||
.expect("Invalid module");
|
||||
wasmparser::validate(&binary).expect("Invalid module");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user