mirror of
https://github.com/eth-act/ere.git
synced 2026-02-19 11:54:42 -05:00
add scaffolding for Compiler trait
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -1650,6 +1650,10 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
||||
[[package]]
|
||||
name = "ere-risczero"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"thiserror 2.0.12",
|
||||
"zkvm-interface",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ere-sp1"
|
||||
|
||||
@@ -6,6 +6,8 @@ rust-version.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
zkvm-interface = { workspace = true }
|
||||
thiserror = "2"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
0
crates/ere-risczero/src/compile.rs
Normal file
0
crates/ere-risczero/src/compile.rs
Normal file
@@ -1,14 +1,20 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
use thiserror::Error;
|
||||
use zkvm_interface::Compiler;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
mod compile;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
#[allow(non_camel_case_types)]
|
||||
pub struct RV32_IM_RISCZERO_ZKVM_ELF;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum RiscZeroError {}
|
||||
|
||||
impl Compiler for RV32_IM_RISCZERO_ZKVM_ELF {
|
||||
type Error = RiscZeroError;
|
||||
|
||||
type Program = Vec<u8>;
|
||||
|
||||
fn compile(path_to_program: &std::path::Path) -> Result<Self::Program, Self::Error> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user