Crates.io | ceres-runtime |
lib.rs | ceres-runtime |
version | 0.2.0 |
source | src |
created_at | 2021-06-14 07:49:42.145456 |
updated_at | 2021-08-02 09:49:06.221231 |
description | Runtime ink! contract anywhere! |
homepage | |
repository | https://github.com/patractlabs/ceres |
max_upload_size | |
id | 409842 |
size | 25,558 |
The wasm executor of ink! contract
This repo provides:
- - - - - - - - - - - - - - - - - - - - -
| ink! contract | ---> | ceres | ---> | anywhere |
- - - - - - - - - - - - - - - - - - - - -
use ceres_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