mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 03:41:02 +00:00
switch to pallet_revive runtime (#40)
Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -129,7 +129,6 @@ impl Compiler {
|
||||
)
|
||||
})?;
|
||||
output.preprocess_ast(&version, pipeline, suppressed_warnings.as_slice())?;
|
||||
output.remove_evm();
|
||||
|
||||
Ok(output)
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
//! The Solidity compiler pipeline type.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::solc::version::Version as SolcVersion;
|
||||
use crate::solc::Compiler as SolcCompiler;
|
||||
|
||||
/// The Solidity compiler pipeline type.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[allow(non_camel_case_types)]
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
pub enum Pipeline {
|
||||
|
||||
@@ -37,6 +37,8 @@ pub enum Flag {
|
||||
/// The EVM legacy assembly JSON.
|
||||
#[serde(rename = "evm.legacyAssembly")]
|
||||
EVMLA,
|
||||
#[serde(rename = "evm.bytecode")]
|
||||
EVMBC,
|
||||
#[serde(rename = "evm.deployedBytecode")]
|
||||
EVMDBC,
|
||||
}
|
||||
@@ -62,6 +64,7 @@ impl std::fmt::Display for Flag {
|
||||
Self::AST => write!(f, "ast"),
|
||||
Self::Yul => write!(f, "irOptimized"),
|
||||
Self::EVMLA => write!(f, "evm.legacyAssembly"),
|
||||
Self::EVMBC => write!(f, "evm.bytecode"),
|
||||
Self::EVMDBC => write!(f, "evm.deployedBytecode"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ impl File {
|
||||
Self {
|
||||
per_file: Some(HashSet::from_iter([SelectionFlag::AST])),
|
||||
per_contract: Some(HashSet::from_iter([
|
||||
SelectionFlag::EVMBC,
|
||||
SelectionFlag::EVMDBC,
|
||||
SelectionFlag::MethodIdentifiers,
|
||||
SelectionFlag::Metadata,
|
||||
|
||||
@@ -138,19 +138,6 @@ impl Output {
|
||||
))
|
||||
}
|
||||
|
||||
/// Removes EVM artifacts to prevent their accidental usage.
|
||||
pub fn remove_evm(&mut self) {
|
||||
if let Some(files) = self.contracts.as_mut() {
|
||||
for (_, file) in files.iter_mut() {
|
||||
for (_, contract) in file.iter_mut() {
|
||||
if let Some(evm) = contract.evm.as_mut() {
|
||||
evm.bytecode = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Traverses the AST and returns the list of additional errors and warnings.
|
||||
pub fn preprocess_ast(
|
||||
&mut self,
|
||||
|
||||
Reference in New Issue
Block a user