Crates.io | inkpad-runtime |
lib.rs | inkpad-runtime |
version | 0.1.0 |
source | src |
created_at | 2022-01-29 09:26:09.520009 |
updated_at | 2022-01-29 09:26:09.520009 |
description | Runtime ink! contract anywhere! |
homepage | |
repository | https://github.com/clearloop/inkpad |
max_upload_size | |
id | 523516 |
size | 25,498 |
The wasm executor of ink! contract
This repo provides:
- - - - - - - - - - - - - - - - - - - - -
| ink! contract | ---> | inkpad | ---> | anywhere |
- - - - - - - - - - - - - - - - - - - - -
use inkpad_runtime::Runtime;
#[test]
fn test_flipper() {
let mut rt = Runtime::from_contract(include_bytes!("../flipper.contract"))
.expect("Create runtime failed");
rt.deploy("default", &[]).expect("Deploy failed");
assert_eq!(&rt.call("get", &[]).expect("Call contract failed"), &[0]);
rt.deploy("new", &["true"]).expect("Deploy failed");
assert_eq!(&rt.call("get", &[]).expect("Call contract failed"), &[1]);
rt.call("flip", &[]).expect("Call contract failed");
assert_eq!(&rt.call("get", &[]).expect("Call contract failed"), &[0]);
}
MIT