mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-12 10:01:07 +00:00
constants.mod, and Display for CaseIdx to use it
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
use semver::Version;
|
||||
|
||||
/// This is the first version of solc that supports the `--via-ir` flag / "viaIR" input JSON.
|
||||
pub const VERSION_SUPPORTING_VIA_IR: Version = Version::new(0, 8, 13);
|
||||
@@ -3,6 +3,8 @@
|
||||
//! - Polkadot revive resolc compiler
|
||||
//! - Polkadot revive Wasm compiler
|
||||
|
||||
mod constants;
|
||||
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs::read_to_string,
|
||||
|
||||
@@ -15,6 +15,7 @@ use revive_solc_json_interface::{
|
||||
};
|
||||
|
||||
use crate::{CompilerInput, CompilerOutput, ModeOptimizerSetting, ModePipeline, SolidityCompiler};
|
||||
use super::constants::VERSION_SUPPORTING_VIA_IR;
|
||||
|
||||
use alloy::json_abi::JsonAbi;
|
||||
use anyhow::Context;
|
||||
@@ -246,7 +247,7 @@ impl SolidityCompiler for Resolc {
|
||||
// We only support the Y (IE compile via Yul IR) mode here, which also means that we can
|
||||
// only use solc version 0.8.13 and above. We must always compile via Yul IR as resolc
|
||||
// needs this to translate to LLVM IR and then RISCV.
|
||||
pipeline == ModePipeline::Y && compiler_version >= &Version::new(0, 8, 13)
|
||||
pipeline == ModePipeline::Y && compiler_version >= &VERSION_SUPPORTING_VIA_IR
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ use revive_dt_config::Arguments;
|
||||
use revive_dt_solc_binaries::download_solc;
|
||||
|
||||
use crate::{CompilerInput, CompilerOutput, ModeOptimizerSetting, ModePipeline, SolidityCompiler};
|
||||
use super::constants::VERSION_SUPPORTING_VIA_IR;
|
||||
|
||||
use anyhow::Context;
|
||||
use foundry_compilers_artifacts::{
|
||||
@@ -23,9 +24,6 @@ use foundry_compilers_artifacts::{
|
||||
use semver::Version;
|
||||
use tokio::{io::AsyncWriteExt, process::Command as AsyncCommand};
|
||||
|
||||
/// This is the first version of solc that supports the `--via-ir` flag / "viaIR" input JSON.
|
||||
const VERSION_SUPPORTING_VIA_IR: Version = Version::new(0, 8, 13);
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Solc {
|
||||
solc_path: PathBuf,
|
||||
|
||||
Reference in New Issue
Block a user