diff --git a/compiler_tester/src/compiler_tester/arguments.rs b/compiler_tester/src/compiler_tester/arguments.rs index 207079e3..5109c95c 100644 --- a/compiler_tester/src/compiler_tester/arguments.rs +++ b/compiler_tester/src/compiler_tester/arguments.rs @@ -6,7 +6,7 @@ use std::path::PathBuf; use structopt::StructOpt; -use compiler_tester::workflow::Workflow; +use compiler_tester::Workflow; /// /// The compiler tester arguments. diff --git a/compiler_tester/src/lib.rs b/compiler_tester/src/lib.rs index 23173531..e2d075e4 100644 --- a/compiler_tester/src/lib.rs +++ b/compiler_tester/src/lib.rs @@ -10,11 +10,12 @@ pub(crate) mod summary; pub(crate) mod test; pub(crate) mod utils; pub(crate) mod vm; -pub mod workflow; +pub(crate) mod workflow; pub use self::filters::Filters; pub use self::llvm_options::LLVMOptions; pub use self::summary::Summary; +pub use self::workflow::Workflow; pub use crate::vm::eravm::deployers::native_deployer::NativeDeployer as EraVMNativeDeployer; pub use crate::vm::eravm::deployers::system_contract_deployer::SystemContractDeployer as EraVMSystemContractDeployer; pub use crate::vm::eravm::EraVM; @@ -27,7 +28,6 @@ use std::sync::Mutex; use itertools::Itertools; use rayon::iter::IntoParallelIterator; use rayon::iter::ParallelIterator; -use workflow::Workflow; pub use crate::compilers::eravm::EraVMCompiler; pub use crate::compilers::llvm::LLVMCompiler; diff --git a/compiler_tester/src/workflow.rs b/compiler_tester/src/workflow.rs index bc86bcf5..862a2c3b 100644 --- a/compiler_tester/src/workflow.rs +++ b/compiler_tester/src/workflow.rs @@ -15,12 +15,9 @@ pub enum Workflow { BuildAndRun, } -// any error type implementing Display is acceptable. -type ParseError = &'static str; - impl FromStr for Workflow { - type Err = ParseError; - + type Err = &'static str; + fn from_str(day: &str) -> Result { match day { "build" => Ok(Workflow::BuildOnly), diff --git a/fuzzer/fuzz_targets/common.rs b/fuzzer/fuzz_targets/common.rs index eb9f04b5..1c1500fe 100644 --- a/fuzzer/fuzz_targets/common.rs +++ b/fuzzer/fuzz_targets/common.rs @@ -3,8 +3,8 @@ use std::{ sync::Arc, }; +use compiler_tester::Workflow; use compiler_tester::{Buildable, EthereumTest, Mode, SolidityCompiler, SolidityMode, Summary}; -use compiler_tester::workflow::Workflow; pub use solidity_adapter::{ test::function_call::parser::{ lexical::token::{ @@ -174,7 +174,7 @@ pub fn build_and_run(test: EthereumTest) -> anyhow::Result { compiler_tester::Summary::new(true, false).wrap(), compiler_tester::Filters::new(vec![], vec![], vec![]), None, - Workflow::BuildAndRun + Workflow::BuildAndRun, )?; zkevm_tester::runners::compiler_tests::set_tracing_mode( zkevm_tester::runners::compiler_tests::VmTracingOptions::from_u64(0),