Skip to content

Commit 03212a3

Browse files
authored
Merge pull request #10 from bandprotocol/gas-metering
Gas metering
2 parents 03274f2 + 77d058c commit 03212a3

File tree

5 files changed

+240
-94
lines changed

5 files changed

+240
-94
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616

1717
- name: Install Wabt (wat2wasm)
1818
run: |
19-
wget https://github.com/WebAssembly/wabt/releases/download/1.0.17/wabt-1.0.17-ubuntu.tar.gz
20-
tar -zxf wabt-1.0.17-ubuntu.tar.gz
21-
sudo cp wabt-1.0.17/bin/wat2wasm /usr/local/bin
19+
wget https://github.com/WebAssembly/wabt/releases/download/1.0.29/wabt-1.0.29-ubuntu.tar.gz
20+
tar -zxf wabt-1.0.29-ubuntu.tar.gz
21+
sudo cp wabt-1.0.29/bin/wat2wasm /usr/local/bin
2222
2323
- name: Check cargo cache
2424
uses: actions/cache@v2

packages/vm/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "owasm-vm"
33
version = "0.1.12"
44
authors = ["Band Protocol <[email protected]>"]
5-
edition = "2018"
5+
edition = "2021"
66
license = "Apache-2.0"
77
repository = "https://github.com/bandprotocol/owasm/tree/master/packages/vm"
88
description = "Oracle script VM runtime"
@@ -13,8 +13,9 @@ assert_matches = "1.3.0"
1313
hex = "0.4"
1414
parity-wasm = "0.41"
1515
pwasm-utils = "0.12"
16-
wasmer = { version = "1.0.2", default-features = false, features = ["jit", "singlepass", "compiler"] }
17-
owasm-crypto = { path = "../crypto", version = "0.1.13" }
16+
wasmer = { version = "2.3.0", default-features = false, features = ["singlepass", "compiler", "universal"] }
17+
wasmer-middlewares = "2.3.0"
18+
# owasm-crypto = { path = "../crypto", version = "0.1.13" }
1819
tempfile = "3.1.0"
1920
clru = "0.2.0"
2021
cosmwasm-vm = "0.13.2"

packages/vm/src/cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ mod test {
8989
use std::io::{Read, Write};
9090
use std::process::Command;
9191
use tempfile::NamedTempFile;
92-
use wasmer::{imports, Singlepass, Store, JIT};
92+
use wasmer::{imports, Singlepass, Store, Universal};
9393

9494
fn wat2wasm(wat: impl AsRef<[u8]>) -> Vec<u8> {
9595
let mut input_file = NamedTempFile::new().unwrap();
@@ -110,7 +110,7 @@ mod test {
110110

111111
fn get_instance_without_err(cache: &mut Cache, wasm: &[u8]) -> wasmer::Instance {
112112
let compiler = Singlepass::new();
113-
let store = Store::new(&JIT::new(compiler).engine());
113+
let store = Store::new(&Universal::new(compiler).engine());
114114
let import_object = imports! {};
115115

116116
match cache.get_instance(&wasm, &store, &import_object) {

0 commit comments

Comments
 (0)