mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-22 10:17:56 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d0cffd24c1 | |||
| f9a63a5641 | |||
| fb009f65c1 | |||
| dff4c25e24 | |||
| e433d93cbf | |||
| 408754e8fb | |||
| 59bfffe5fe | |||
| 380ea693be | |||
| d02152b565 | |||
| 75159229df |
+5
-1
@@ -12,4 +12,8 @@ profile.json.gz
|
|||||||
workdir
|
workdir
|
||||||
|
|
||||||
!/schema.json
|
!/schema.json
|
||||||
!/dev-genesis.json
|
!/dev-genesis.json
|
||||||
|
|
||||||
|
# Ignore all shell scripts except for the `run_tests.sh` script
|
||||||
|
*.sh
|
||||||
|
!run_tests.sh
|
||||||
@@ -16,6 +16,7 @@ use alloy::{
|
|||||||
primitives::{B256, FixedBytes, U256},
|
primitives::{B256, FixedBytes, U256},
|
||||||
signers::local::PrivateKeySigner,
|
signers::local::PrivateKeySigner,
|
||||||
};
|
};
|
||||||
|
use anyhow::Context as _;
|
||||||
use clap::{Parser, ValueEnum, ValueHint};
|
use clap::{Parser, ValueEnum, ValueHint};
|
||||||
use revive_dt_common::types::{ParsedTestSpecifier, PlatformIdentifier};
|
use revive_dt_common::types::{ParsedTestSpecifier, PlatformIdentifier};
|
||||||
use semver::Version;
|
use semver::Version;
|
||||||
@@ -1079,7 +1080,10 @@ impl FromStr for WorkingDirectoryConfiguration {
|
|||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
match s {
|
match s {
|
||||||
"" => Ok(Default::default()),
|
"" => Ok(Default::default()),
|
||||||
_ => Ok(Self::Path(PathBuf::from(s))),
|
_ => PathBuf::from(s)
|
||||||
|
.canonicalize()
|
||||||
|
.context("Failed to canonicalize the working directory path")
|
||||||
|
.map(Self::Path),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -359,7 +359,11 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument(level = "info", skip_all)]
|
#[instrument(
|
||||||
|
level = "info",
|
||||||
|
skip_all,
|
||||||
|
fields(block_number = tracing::field::Empty)
|
||||||
|
)]
|
||||||
pub async fn execute_function_call(
|
pub async fn execute_function_call(
|
||||||
&mut self,
|
&mut self,
|
||||||
_: &StepPath,
|
_: &StepPath,
|
||||||
@@ -373,6 +377,7 @@ where
|
|||||||
.handle_function_call_execution(step, deployment_receipts)
|
.handle_function_call_execution(step, deployment_receipts)
|
||||||
.await
|
.await
|
||||||
.context("Failed to handle the function call execution")?;
|
.context("Failed to handle the function call execution")?;
|
||||||
|
tracing::Span::current().record("block_number", execution_receipt.block_number);
|
||||||
let tracing_result = self
|
let tracing_result = self
|
||||||
.handle_function_call_call_frame_tracing(execution_receipt.transaction_hash)
|
.handle_function_call_call_frame_tracing(execution_receipt.transaction_hash)
|
||||||
.await
|
.await
|
||||||
@@ -616,8 +621,8 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handling the calldata assertion
|
// Handling the calldata assertion
|
||||||
if let Some(ref expected_calldata) = assertion.return_data {
|
if let Some(ref expected_output) = assertion.return_data {
|
||||||
let expected = expected_calldata;
|
let expected = expected_output;
|
||||||
let actual = &tracing_result.output.as_ref().unwrap_or_default();
|
let actual = &tracing_result.output.as_ref().unwrap_or_default();
|
||||||
if !expected
|
if !expected
|
||||||
.is_equivalent(actual, resolver.as_ref(), resolution_context)
|
.is_equivalent(actual, resolver.as_ref(), resolution_context)
|
||||||
@@ -628,9 +633,9 @@ where
|
|||||||
?receipt,
|
?receipt,
|
||||||
?expected,
|
?expected,
|
||||||
%actual,
|
%actual,
|
||||||
"Calldata assertion failed"
|
"Output assertion failed"
|
||||||
);
|
);
|
||||||
anyhow::bail!("Calldata assertion failed - Expected {expected:?} but got {actual}",);
|
anyhow::bail!("Output assertion failed - Expected {expected:?} but got {actual}",);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -706,6 +706,7 @@ impl Calldata {
|
|||||||
.await
|
.await
|
||||||
.context("Failed to resolve calldata item during equivalence check")?;
|
.context("Failed to resolve calldata item during equivalence check")?;
|
||||||
let other = U256::from_be_slice(&other);
|
let other = U256::from_be_slice(&other);
|
||||||
|
|
||||||
Ok(this == other)
|
Ok(this == other)
|
||||||
})
|
})
|
||||||
.buffered(0xFF)
|
.buffered(0xFF)
|
||||||
@@ -718,7 +719,7 @@ impl Calldata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl CalldataItem {
|
impl CalldataItem {
|
||||||
#[instrument(level = "info", skip_all, err)]
|
#[instrument(level = "info", skip_all, err(Debug))]
|
||||||
async fn resolve(
|
async fn resolve(
|
||||||
&self,
|
&self,
|
||||||
resolver: &(impl ResolverApi + ?Sized),
|
resolver: &(impl ResolverApi + ?Sized),
|
||||||
@@ -906,7 +907,7 @@ impl<T: AsRef<str>> CalldataToken<T> {
|
|||||||
let block_hash = resolver
|
let block_hash = resolver
|
||||||
.block_hash(desired_block_number.into())
|
.block_hash(desired_block_number.into())
|
||||||
.await
|
.await
|
||||||
.context("Failed to resolve block hash for desired block number")?;
|
.context(format!("Failed to resolve the block hash of block number {desired_block_number}"))?;
|
||||||
|
|
||||||
Ok(U256::from_be_bytes(block_hash.0))
|
Ok(U256::from_be_bytes(block_hash.0))
|
||||||
} else if item == Self::BLOCK_NUMBER_VARIABLE {
|
} else if item == Self::BLOCK_NUMBER_VARIABLE {
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ impl SubstrateNode {
|
|||||||
.arg(format!("ws://127.0.0.1:{substrate_rpc_port}"))
|
.arg(format!("ws://127.0.0.1:{substrate_rpc_port}"))
|
||||||
.arg("--rpc-max-connections")
|
.arg("--rpc-max-connections")
|
||||||
.arg(u32::MAX.to_string())
|
.arg(u32::MAX.to_string())
|
||||||
|
.arg("--index-last-n-blocks")
|
||||||
|
.arg(1_000u32.to_string())
|
||||||
|
.arg("--cache-size")
|
||||||
|
.arg(1_000u32.to_string())
|
||||||
.env("RUST_LOG", Self::PROXY_LOG_ENV)
|
.env("RUST_LOG", Self::PROXY_LOG_ENV)
|
||||||
.stdout(stdout_file)
|
.stdout(stdout_file)
|
||||||
.stderr(stderr_file);
|
.stderr(stderr_file);
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ where
|
|||||||
};
|
};
|
||||||
debug!(%tx_hash, "Submitted Transaction");
|
debug!(%tx_hash, "Submitted Transaction");
|
||||||
|
|
||||||
pending_transaction.set_timeout(Some(Duration::from_secs(240)));
|
pending_transaction.set_timeout(Some(Duration::from_secs(120)));
|
||||||
let tx_hash = pending_transaction.watch().await.context(format!(
|
let tx_hash = pending_transaction.watch().await.context(format!(
|
||||||
"Transaction inclusion watching timeout for {tx_hash}"
|
"Transaction inclusion watching timeout for {tx_hash}"
|
||||||
))?;
|
))?;
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
|
str::FromStr,
|
||||||
sync::{LazyLock, Mutex},
|
sync::{LazyLock, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
use revive_dt_common::types::VersionOrRequirement;
|
use revive_dt_common::types::VersionOrRequirement;
|
||||||
|
|
||||||
use semver::Version;
|
use semver::{Version, VersionReq};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
|
|
||||||
use crate::list::List;
|
use crate::list::List;
|
||||||
@@ -65,6 +66,9 @@ impl SolcDownloader {
|
|||||||
target: &'static str,
|
target: &'static str,
|
||||||
list: &'static str,
|
list: &'static str,
|
||||||
) -> anyhow::Result<Self> {
|
) -> anyhow::Result<Self> {
|
||||||
|
static MAXIMUM_COMPILER_VERSION_REQUIREMENT: LazyLock<VersionReq> =
|
||||||
|
LazyLock::new(|| VersionReq::from_str("<=0.8.30").unwrap());
|
||||||
|
|
||||||
let version_or_requirement = version.into();
|
let version_or_requirement = version.into();
|
||||||
match version_or_requirement {
|
match version_or_requirement {
|
||||||
VersionOrRequirement::Version(version) => Ok(Self {
|
VersionOrRequirement::Version(version) => Ok(Self {
|
||||||
@@ -79,7 +83,10 @@ impl SolcDownloader {
|
|||||||
.builds
|
.builds
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|build| build.version)
|
.map(|build| build.version)
|
||||||
.filter(|version| requirement.matches(version))
|
.filter(|version| {
|
||||||
|
MAXIMUM_COMPILER_VERSION_REQUIREMENT.matches(version)
|
||||||
|
&& requirement.matches(version)
|
||||||
|
})
|
||||||
.max()
|
.max()
|
||||||
else {
|
else {
|
||||||
anyhow::bail!("Failed to find a version that satisfies {requirement:?}");
|
anyhow::bail!("Failed to find a version that satisfies {requirement:?}");
|
||||||
|
|||||||
+1
-1
Submodule polkadot-sdk updated: f268e32768...45a0ea734f
+1
-1
Submodule resolc-compiler-tests updated: ce77cb1166...40ffa2b839
Reference in New Issue
Block a user