2 releases
0.1.0 | Mar 15, 2023 |
---|---|
0.1.0-alpha | Feb 6, 2023 |
#1942 in Magic Beans
67 downloads per month
Used in piecrust
26KB
664 lines
π-crust
WASM virtual machine handling Dusk's smart contracts.
Usage
use piecrust::{Error, VM};
let bytecode = // load module bytecode ;
let mut vm = VM::ephemeral()?;
let module_id = vm.deploy(bytecode)?;
let mut session = vm.session();
let result = session.transact::<i16, i32>(module_id, "function_name", &0x11)?;
// use result
Build and Test
To build and test the crate one will need a
Rust toolchain, Make, and the
wasm-tools
binary.
sudo apt install -y make # ubuntu/debian - adapt to own system
cargo install wasm-tools
make test
Dependencies
~1.8–2.4MB
~51K SLoC