mirror of
https://github.com/eth-act/ere.git
synced 2026-04-03 03:00:17 -04:00
Use test-utils for all zkvms (#88)
This commit is contained in:
10
tests/risc0/basic/Cargo.toml
Normal file
10
tests/risc0/basic/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "ere-test-risc0-guest"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[workspace]
|
||||
|
||||
[dependencies]
|
||||
risc0-zkvm = { version = "2.3.1", default-features = false, features = ['std', 'unstable'] }
|
||||
test-utils = { path = "../../../crates/test-utils" }
|
||||
15
tests/risc0/basic/src/main.rs
Normal file
15
tests/risc0/basic/src/main.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use risc0_zkvm::guest::env;
|
||||
use test_utils::guest::BasicStruct;
|
||||
|
||||
fn main() {
|
||||
// Read `Hello world` bytes.
|
||||
let bytes = env::read_frame();
|
||||
assert_eq!(String::from_utf8_lossy(&bytes), "Hello world");
|
||||
|
||||
// Read `BasicStruct`.
|
||||
let basic_struct = env::read::<BasicStruct>();
|
||||
let output = basic_struct.output();
|
||||
|
||||
// Write `output`
|
||||
env::commit(&output);
|
||||
}
|
||||
Reference in New Issue
Block a user