mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-30 18:47:58 +00:00
Added implementation for resolc trait (#12)
Implement the Solidity Compiler trait for resolc
This commit is contained in:
@@ -8,7 +8,6 @@ use revive_dt_compiler::{Compiler, CompilerInput, SolidityCompiler};
|
||||
use revive_dt_config::Arguments;
|
||||
use revive_dt_format::{input::Input, metadata::Metadata, mode::SolcMode};
|
||||
use revive_dt_node_interaction::EthereumNode;
|
||||
use revive_dt_solc_binaries::download_solc;
|
||||
use revive_solc_json_interface::SolcStandardJsonOutput;
|
||||
|
||||
use crate::Platform;
|
||||
@@ -43,16 +42,18 @@ where
|
||||
|
||||
let sources = metadata.contract_sources()?;
|
||||
let base_path = metadata.directory()?.display().to_string();
|
||||
|
||||
let mut compiler = Compiler::<T::Compiler>::new().base_path(base_path.clone());
|
||||
for (file, _contract) in sources.values() {
|
||||
log::debug!("contract source {}", file.display());
|
||||
compiler = compiler.with_source(file)?;
|
||||
}
|
||||
|
||||
let solc_path = download_solc(self.config.directory(), version, self.config.wasm)?;
|
||||
let compiler_path = T::Compiler::get_compiler_executable(self.config, version)?;
|
||||
|
||||
let output = compiler
|
||||
.solc_optimizer(mode.solc_optimize())
|
||||
.try_build(solc_path)?;
|
||||
.try_build(compiler_path)?;
|
||||
|
||||
self.contracts.insert(output.input, output.output);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user