mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-13 07:01:04 +00:00
fix
This commit is contained in:
@@ -10,8 +10,7 @@ use std::{
|
||||
pin::Pin,
|
||||
};
|
||||
|
||||
use alloy::json_abi::JsonAbi;
|
||||
use alloy::primitives::Address;
|
||||
use alloy::{json_abi::JsonAbi, primitives::Address};
|
||||
use anyhow::{Context as _, Result};
|
||||
use semver::Version;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -141,9 +141,7 @@ impl SolidityCompiler for Resolc {
|
||||
output_selection: Some(SolcStandardJsonInputSettingsSelection::new_required()),
|
||||
via_ir: Some(true),
|
||||
optimizer: SolcStandardJsonInputSettingsOptimizer::new(
|
||||
optimization
|
||||
.unwrap_or(ModeOptimizerSetting::M0)
|
||||
.optimizations_enabled(),
|
||||
optimization.unwrap_or(ModeOptimizerSetting::M0).optimizations_enabled(),
|
||||
None,
|
||||
&Version::new(0, 0, 0),
|
||||
false,
|
||||
|
||||
@@ -21,8 +21,7 @@ use foundry_compilers_artifacts::{
|
||||
output_selection::{
|
||||
BytecodeOutputSelection, ContractOutputSelection, EvmOutputSelection, OutputSelection,
|
||||
},
|
||||
solc::CompilerOutput as SolcOutput,
|
||||
solc::*,
|
||||
solc::{CompilerOutput as SolcOutput, *},
|
||||
};
|
||||
use semver::Version;
|
||||
use tokio::{io::AsyncWriteExt, process::Command as AsyncCommand};
|
||||
@@ -57,9 +56,7 @@ impl Solc {
|
||||
// resolution for us. Therefore, even if the download didn't proceed, this function will
|
||||
// resolve the version requirement into a canonical version of the compiler. It's then up
|
||||
// to us to either use the provided path or not.
|
||||
let version = version
|
||||
.into()
|
||||
.unwrap_or_else(|| solc_configuration.version.clone().into());
|
||||
let version = version.into().unwrap_or_else(|| solc_configuration.version.clone().into());
|
||||
let (version, path) =
|
||||
download_solc(working_directory_configuration.as_path(), version, false)
|
||||
.await
|
||||
@@ -253,10 +250,7 @@ impl SolidityCompiler for Solc {
|
||||
let map = compiler_output
|
||||
.contracts
|
||||
.entry(contract_path.canonicalize().with_context(|| {
|
||||
format!(
|
||||
"Failed to canonicalize contract path {}",
|
||||
contract_path.display()
|
||||
)
|
||||
format!("Failed to canonicalize contract path {}", contract_path.display())
|
||||
})?)
|
||||
.or_default();
|
||||
for (contract_name, contract_info) in contracts.into_iter() {
|
||||
|
||||
@@ -9,9 +9,8 @@ use semver::Version;
|
||||
async fn contracts_can_be_compiled_with_solc() {
|
||||
// Arrange
|
||||
let args = TestExecutionContext::default();
|
||||
let solc = Solc::new(&args, VersionOrRequirement::Version(Version::new(0, 8, 30)))
|
||||
.await
|
||||
.unwrap();
|
||||
let solc =
|
||||
Solc::new(&args, VersionOrRequirement::Version(Version::new(0, 8, 30))).await.unwrap();
|
||||
|
||||
// Act
|
||||
let output = Compiler::new()
|
||||
@@ -28,18 +27,12 @@ async fn contracts_can_be_compiled_with_solc() {
|
||||
|
||||
let main_file_contracts = output
|
||||
.contracts
|
||||
.get(
|
||||
&PathBuf::from("./tests/assets/array_one_element/main.sol")
|
||||
.canonicalize()
|
||||
.unwrap(),
|
||||
)
|
||||
.get(&PathBuf::from("./tests/assets/array_one_element/main.sol").canonicalize().unwrap())
|
||||
.unwrap();
|
||||
let callable_file_contracts = output
|
||||
.contracts
|
||||
.get(
|
||||
&PathBuf::from("./tests/assets/array_one_element/callable.sol")
|
||||
.canonicalize()
|
||||
.unwrap(),
|
||||
&PathBuf::from("./tests/assets/array_one_element/callable.sol").canonicalize().unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
assert!(main_file_contracts.contains_key("Main"));
|
||||
@@ -50,9 +43,8 @@ async fn contracts_can_be_compiled_with_solc() {
|
||||
async fn contracts_can_be_compiled_with_resolc() {
|
||||
// Arrange
|
||||
let args = TestExecutionContext::default();
|
||||
let resolc = Resolc::new(&args, VersionOrRequirement::Version(Version::new(0, 8, 30)))
|
||||
.await
|
||||
.unwrap();
|
||||
let resolc =
|
||||
Resolc::new(&args, VersionOrRequirement::Version(Version::new(0, 8, 30))).await.unwrap();
|
||||
|
||||
// Act
|
||||
let output = Compiler::new()
|
||||
@@ -69,18 +61,12 @@ async fn contracts_can_be_compiled_with_resolc() {
|
||||
|
||||
let main_file_contracts = output
|
||||
.contracts
|
||||
.get(
|
||||
&PathBuf::from("./tests/assets/array_one_element/main.sol")
|
||||
.canonicalize()
|
||||
.unwrap(),
|
||||
)
|
||||
.get(&PathBuf::from("./tests/assets/array_one_element/main.sol").canonicalize().unwrap())
|
||||
.unwrap();
|
||||
let callable_file_contracts = output
|
||||
.contracts
|
||||
.get(
|
||||
&PathBuf::from("./tests/assets/array_one_element/callable.sol")
|
||||
.canonicalize()
|
||||
.unwrap(),
|
||||
&PathBuf::from("./tests/assets/array_one_element/callable.sol").canonicalize().unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
assert!(main_file_contracts.contains_key("Main"));
|
||||
|
||||
Reference in New Issue
Block a user