mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-10 17:21:02 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d8017b4ddf | |||
| eacc09fe4f | |||
| 7ef76bb470 |
@@ -10,10 +10,6 @@ use crate::{CompilerInput, CompilerOutput, SolidityCompiler};
|
|||||||
use revive_dt_config::Arguments;
|
use revive_dt_config::Arguments;
|
||||||
use revive_solc_json_interface::SolcStandardJsonOutput;
|
use revive_solc_json_interface::SolcStandardJsonOutput;
|
||||||
|
|
||||||
// TODO: I believe that we need to also pass the solc compiler to resolc so that resolc uses the
|
|
||||||
// specified solc compiler. I believe that currently we completely ignore the specified solc binary
|
|
||||||
// when invoking resolc which doesn't seem right if we're using solc as a compiler frontend.
|
|
||||||
|
|
||||||
/// A wrapper around the `resolc` binary, emitting PVM-compatible bytecode.
|
/// A wrapper around the `resolc` binary, emitting PVM-compatible bytecode.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Resolc {
|
pub struct Resolc {
|
||||||
|
|||||||
@@ -200,13 +200,12 @@ where
|
|||||||
case_idx: CaseIdx,
|
case_idx: CaseIdx,
|
||||||
input: &Input,
|
input: &Input,
|
||||||
node: &T::Blockchain,
|
node: &T::Blockchain,
|
||||||
mode: &SolcMode,
|
|
||||||
) -> anyhow::Result<(TransactionReceipt, GethTrace, DiffMode)> {
|
) -> anyhow::Result<(TransactionReceipt, GethTrace, DiffMode)> {
|
||||||
let deployment_receipts =
|
let deployment_receipts =
|
||||||
self.handle_contract_deployment(metadata, case_idx, input, node)?;
|
self.handle_contract_deployment(metadata, case_idx, input, node)?;
|
||||||
let execution_receipt =
|
let execution_receipt =
|
||||||
self.handle_input_execution(case_idx, input, deployment_receipts, node)?;
|
self.handle_input_execution(case_idx, input, deployment_receipts, node)?;
|
||||||
self.handle_input_expectations(case_idx, input, &execution_receipt, node, mode)?;
|
self.handle_input_expectations(case_idx, input, &execution_receipt, node)?;
|
||||||
self.handle_input_diff(case_idx, execution_receipt, node)
|
self.handle_input_diff(case_idx, execution_receipt, node)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,7 +312,6 @@ where
|
|||||||
input: &Input,
|
input: &Input,
|
||||||
execution_receipt: &TransactionReceipt,
|
execution_receipt: &TransactionReceipt,
|
||||||
node: &T::Blockchain,
|
node: &T::Blockchain,
|
||||||
mode: &SolcMode,
|
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let span = tracing::info_span!("Handling input expectations");
|
let span = tracing::info_span!("Handling input expectations");
|
||||||
let _guard = span.enter();
|
let _guard = span.enter();
|
||||||
@@ -369,7 +367,6 @@ where
|
|||||||
node,
|
node,
|
||||||
expectation,
|
expectation,
|
||||||
&tracing_result,
|
&tracing_result,
|
||||||
mode,
|
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,16 +380,11 @@ where
|
|||||||
node: &T::Blockchain,
|
node: &T::Blockchain,
|
||||||
expectation: &ExpectedOutput,
|
expectation: &ExpectedOutput,
|
||||||
tracing_result: &CallFrame,
|
tracing_result: &CallFrame,
|
||||||
mode: &SolcMode,
|
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
if let Some(ref version_requirement) = expectation.compiler_version {
|
// TODO: We want to respect the compiler version filter on the expected output but would
|
||||||
let Some(compiler_version) = mode.last_patch_version(&self.config.solc) else {
|
// require some changes to the interfaces of the compiler and such. So, we add it later.
|
||||||
anyhow::bail!("unsupported solc version: {:?}", &mode.solc_version);
|
// Additionally, what happens if the compiler filter doesn't match? Do we consider that the
|
||||||
};
|
// transaction should succeed? Do we just ignore the expectation?
|
||||||
if !version_requirement.matches(&compiler_version) {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let deployed_contracts = self.deployed_contracts(case_idx);
|
let deployed_contracts = self.deployed_contracts(case_idx);
|
||||||
let chain_state_provider = node;
|
let chain_state_provider = node;
|
||||||
@@ -873,13 +865,8 @@ where
|
|||||||
tracing::info_span!("Executing input", contract_name = ?input.instance)
|
tracing::info_span!("Executing input", contract_name = ?input.instance)
|
||||||
.in_scope(|| {
|
.in_scope(|| {
|
||||||
let (leader_receipt, _, leader_diff) = match leader_state
|
let (leader_receipt, _, leader_diff) = match leader_state
|
||||||
.handle_input(
|
.handle_input(self.metadata, case_idx, &input, self.leader_node)
|
||||||
self.metadata,
|
{
|
||||||
case_idx,
|
|
||||||
&input,
|
|
||||||
self.leader_node,
|
|
||||||
&mode,
|
|
||||||
) {
|
|
||||||
Ok(result) => result,
|
Ok(result) => result,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
tracing::error!(
|
tracing::error!(
|
||||||
@@ -908,7 +895,6 @@ where
|
|||||||
case_idx,
|
case_idx,
|
||||||
&input,
|
&input,
|
||||||
self.follower_node,
|
self.follower_node,
|
||||||
&mode,
|
|
||||||
) {
|
) {
|
||||||
Ok(result) => result,
|
Ok(result) => result,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user