-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(verifier): update zksync input related structs to correspond to t…
…he latest zksync compiler version
- Loading branch information
1 parent
fed5068
commit d2c66ee
Showing
7 changed files
with
85 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 27 additions & 4 deletions
31
...verifier/src/zksync/zksolc_standard_json/era_compiler_llvm_context/eravm_metadata_hash.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
use serde::{Deserialize, Serialize}; | ||
//! | ||
//! The hash type. | ||
//! | ||
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Hash)] | ||
pub enum MetadataHash { | ||
use std::str::FromStr; | ||
|
||
/// | ||
/// The hash type. | ||
/// | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] | ||
pub enum Type { | ||
/// Do not include bytecode hash. | ||
#[serde(rename = "none")] | ||
None, | ||
/// The default keccak256 hash. | ||
/// The `keccak256`` hash type. | ||
#[serde(rename = "keccak256")] | ||
Keccak256, | ||
/// The `ipfs` hash. | ||
#[serde(rename = "ipfs")] | ||
Ipfs, | ||
} | ||
|
||
impl FromStr for Type { | ||
type Err = anyhow::Error; | ||
|
||
fn from_str(string: &str) -> Result<Self, Self::Err> { | ||
match string { | ||
"none" => Ok(Self::None), | ||
"keccak256" => Ok(Self::Keccak256), | ||
"ipfs" => Ok(Self::Ipfs), | ||
string => anyhow::bail!("unknown bytecode hash mode: `{string}`"), | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../smart-contract-verifier/src/zksync/zksolc_standard_json/era_compiler_llvm_context/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
mod eravm_metadata_hash; | ||
|
||
pub use eravm_metadata_hash::MetadataHash as EraVMMetadataHash; | ||
pub use eravm_metadata_hash::Type as HashType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters