Skip to content

Commit

Permalink
Merge pull request #24 from Layr-Labs/hope/uncomment-test-crate
Browse files Browse the repository at this point in the history
Uncomment passing arbitrator JIT test test_crate
  • Loading branch information
epociask authored Aug 13, 2024
2 parents 7b7729c + 713c6d5 commit e655c8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions arbitrator/jit/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@

#![cfg(test)]

// use wasmer::{imports, Instance, Module, Store, Value};
use wasmer::{imports, Instance, Module, Store, Value};

// #[test]
// fn test_crate() -> eyre::Result<()> {
// // Adapted from https://docs.rs/wasmer/3.1.0/wasmer/index.html
#[test]
fn test_crate() -> eyre::Result<()> {
// Adapted from https://docs.rs/wasmer/3.1.0/wasmer/index.html

// let source = std::fs::read("programs/pure/main.wat")?;
let source = std::fs::read("programs/pure/main.wat")?;

// let mut store = Store::default();
// let module = Module::new(&store, source)?;
// let imports = imports! {};
// let instance = Instance::new(&mut store, &module, &imports)?;
let mut store = Store::default();
let module = Module::new(&store, source)?;
let imports = imports! {};
let instance = Instance::new(&mut store, &module, &imports)?;

// let add_one = instance.exports.get_function("add_one")?;
// let result = add_one.call(&mut store, &[Value::I32(42)])?;
// assert_eq!(result[0], Value::I32(43));
// Ok(())
// }
let add_one = instance.exports.get_function("add_one")?;
let result = add_one.call(&mut store, &[Value::I32(42)])?;
assert_eq!(result[0], Value::I32(43));
Ok(())
}
2 changes: 1 addition & 1 deletion nitro-testnode

0 comments on commit e655c8d

Please sign in to comment.