mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-29 05:27:57 +00:00
factor out solc JSON interface crate (#264)
The differential testing framework will make a second consumer. There seems to be no re-usable Rust crate for this. But we already have everything here, just needs a small refactor to make it fully re-usable. - Mostly decouple the solc JSON-input-output interface types from the `solidity` frontend crate - Expose the JSON-input-output interface types in a dedicated crate --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
//! The metadata hash mode.
|
||||
|
||||
use std::str::FromStr;
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
/// The metadata hash mode.
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum MetadataHash {
|
||||
/// Do not include bytecode hash.
|
||||
#[serde(rename = "none")]
|
||||
None,
|
||||
/// The default keccak256 hash.
|
||||
#[serde(rename = "keccak256")]
|
||||
Keccak256,
|
||||
}
|
||||
|
||||
impl FromStr for MetadataHash {
|
||||
type Err = anyhow::Error;
|
||||
|
||||
fn from_str(string: &str) -> Result<Self, Self::Err> {
|
||||
match string {
|
||||
"none" => Ok(Self::None),
|
||||
"keccak256" => Ok(Self::Keccak256),
|
||||
_ => anyhow::bail!("Unknown bytecode hash mode: `{}`", string),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
pub mod r#const;
|
||||
pub mod context;
|
||||
pub mod evm;
|
||||
pub mod metadata_hash;
|
||||
|
||||
pub use self::r#const::*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user