zkvm-interface: allow dynamic dispatch in zkVM trait (#52)

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This commit is contained in:
Ignacio Hagopian
2025-07-14 01:02:12 +02:00
committed by GitHub
parent 47e33298fb
commit 94b026dc4b
7 changed files with 14 additions and 14 deletions

View File

@@ -104,11 +104,11 @@ impl zkVM for EreJolt {
}
}
fn name() -> &'static str {
fn name(&self) -> &'static str {
NAME
}
fn sdk_version() -> &'static str {
fn sdk_version(&self) -> &'static str {
SDK_VERSION
}
}

View File

@@ -165,11 +165,11 @@ impl zkVM for EreOpenVM {
.map_err(zkVMError::from)
}
fn name() -> &'static str {
fn name(&self) -> &'static str {
NAME
}
fn sdk_version() -> &'static str {
fn sdk_version(&self) -> &'static str {
SDK_VERSION
}
}

View File

@@ -128,11 +128,11 @@ impl zkVM for ErePico {
todo!("Verification method missing from sdk")
}
fn name() -> &'static str {
fn name(&self) -> &'static str {
NAME
}
fn sdk_version() -> &'static str {
fn sdk_version(&self) -> &'static str {
SDK_VERSION
}
}

View File

@@ -124,11 +124,11 @@ impl zkVM for EreRisc0 {
.map_err(|err| zkVMError::Other(Box::new(err)))
}
fn name() -> &'static str {
fn name(&self) -> &'static str {
NAME
}
fn sdk_version() -> &'static str {
fn sdk_version(&self) -> &'static str {
SDK_VERSION
}
}

View File

@@ -215,11 +215,11 @@ impl zkVM for EreSP1 {
client.verify(&proof, &self.vk).map_err(zkVMError::from)
}
fn name() -> &'static str {
fn name(&self) -> &'static str {
NAME
}
fn sdk_version() -> &'static str {
fn sdk_version(&self) -> &'static str {
SDK_VERSION
}
}

View File

@@ -248,11 +248,11 @@ impl zkVM for EreZisk {
Ok(())
}
fn name() -> &'static str {
fn name(&self) -> &'static str {
NAME
}
fn sdk_version() -> &'static str {
fn sdk_version(&self) -> &'static str {
SDK_VERSION
}
}

View File

@@ -83,8 +83,8 @@ pub trait zkVM {
fn verify(&self, proof: &[u8]) -> Result<(), zkVMError>;
/// Returns the name of the zkVM
fn name() -> &'static str;
fn name(&self) -> &'static str;
/// Returns the version of the zkVM SDK (e.g. 0.1.0)
fn sdk_version() -> &'static str;
fn sdk_version(&self) -> &'static str;
}