2017-04-04 16:06:58 +03:00
# parity-wasm
2017-04-04 16:15:05 +03:00
[](https://travis-ci.org/NikVolf/parity-wasm)
2017-05-30 22:45:14 +04:00
[](https://crates.io/crates/parity-wasm)
2017-04-04 16:15:05 +03:00
2017-04-04 16:43:30 +03:00
[Documentation ](https://nikvolf.github.io/parity-wasm/parity_wasm/ )
2017-04-04 16:08:20 +03:00
## Rust WebAssembly format serializing/deserializing
2017-04-04 16:06:58 +03:00
2017-05-23 17:37:57 +04:00
along with experimental interpreter
2017-04-04 16:06:58 +03:00
```rust
extern crate parity_wasm;
2017-06-03 23:45:42 +02:00
let module = parity_wasm::deserialize_file("./res/cases/v1/hello.wasm");
2017-04-04 16:06:58 +03:00
assert_eq!(module.code_section().is_some());
2017-04-04 16:07:55 +03:00
let code_section = module.code_section().unwrap(); // Part of the module with functions code
println!("Function count in wasm file: {}", code_section.bodies().len());
2017-04-04 16:06:58 +03:00
```
2017-04-04 16:48:01 +03:00
2017-06-05 17:05:11 +04:00
## Wabt Test suite
There is work in progress on supporting wabt test suite (https://github.com/WebAssembly/testsuite), only limited subset of the wabt tests are executed in the moment. To run those tests:
2017-06-05 17:05:52 +04:00
- make sure you have all prerequisites to build `wabt` (since parity-wasm builds it internally using `cmake` , see https://github.com/WebAssembly/wabt)
2017-06-06 13:40:10 +04:00
- checkout with submodules (`git submodule update --init --recurive` )
2017-06-05 17:05:11 +04:00
- run `cargo test --release --manifest-path=spec/Cargo.toml`
2017-04-04 16:48:01 +03:00
# License
`parity-wasm` is primarily distributed under the terms of both the MIT
license and the Apache License (Version 2.0), at your choice.
2017-05-23 17:37:57 +04:00
See LICENSE-APACHE, and LICENSE-MIT for details.