Compare commits

..

3 Commits

Author SHA1 Message Date
Omar Abdulla d8017b4ddf Support linking at compile time 2025-07-25 09:37:24 +03:00
Omar Abdulla eacc09fe4f Create a unified way to access deployed contracts 2025-07-24 20:16:07 +03:00
Omar Abdulla 7ef76bb470 Use wrappers for libraries in metadata. 2025-07-24 19:07:06 +03:00
2 changed files with 7 additions and 25 deletions
-4
View File
@@ -10,10 +10,6 @@ use crate::{CompilerInput, CompilerOutput, SolidityCompiler};
use revive_dt_config::Arguments;
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.
#[derive(Debug)]
pub struct Resolc {
+7 -21
View File
@@ -200,13 +200,12 @@ where
case_idx: CaseIdx,
input: &Input,
node: &T::Blockchain,
mode: &SolcMode,
) -> anyhow::Result<(TransactionReceipt, GethTrace, DiffMode)> {
let deployment_receipts =
self.handle_contract_deployment(metadata, case_idx, input, node)?;
let execution_receipt =
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)
}
@@ -313,7 +312,6 @@ where
input: &Input,
execution_receipt: &TransactionReceipt,
node: &T::Blockchain,
mode: &SolcMode,
) -> anyhow::Result<()> {
let span = tracing::info_span!("Handling input expectations");
let _guard = span.enter();
@@ -369,7 +367,6 @@ where
node,
expectation,
&tracing_result,
mode,
)?;
}
@@ -383,16 +380,11 @@ where
node: &T::Blockchain,
expectation: &ExpectedOutput,
tracing_result: &CallFrame,
mode: &SolcMode,
) -> anyhow::Result<()> {
if let Some(ref version_requirement) = expectation.compiler_version {
let Some(compiler_version) = mode.last_patch_version(&self.config.solc) else {
anyhow::bail!("unsupported solc version: {:?}", &mode.solc_version);
};
if !version_requirement.matches(&compiler_version) {
return Ok(());
}
}
// TODO: We want to respect the compiler version filter on the expected output but would
// require some changes to the interfaces of the compiler and such. So, we add it later.
// Additionally, what happens if the compiler filter doesn't match? Do we consider that the
// transaction should succeed? Do we just ignore the expectation?
let deployed_contracts = self.deployed_contracts(case_idx);
let chain_state_provider = node;
@@ -873,13 +865,8 @@ where
tracing::info_span!("Executing input", contract_name = ?input.instance)
.in_scope(|| {
let (leader_receipt, _, leader_diff) = match leader_state
.handle_input(
self.metadata,
case_idx,
&input,
self.leader_node,
&mode,
) {
.handle_input(self.metadata, case_idx, &input, self.leader_node)
{
Ok(result) => result,
Err(error) => {
tracing::error!(
@@ -908,7 +895,6 @@ where
case_idx,
&input,
self.follower_node,
&mode,
) {
Ok(result) => result,
Err(error) => {