Compare commits

..

5 Commits

Author SHA1 Message Date
Omar Abdulla 949d7d3802 Fix the working directory canonicalization 2025-11-04 06:12:49 +03:00
Omar Abdulla 6a20dbf058 Update the resolc compiler tests 2025-11-04 05:25:13 +03:00
Omar Abdulla 9987952c63 Fix an issue with file errors in substrate export-chainspec 2025-11-04 05:17:32 +03:00
Omar Abdulla 2087453634 Merge remote-tracking branch 'origin/main' into fix/os-error-in-substrate-export-chainspec 2025-11-04 05:17:06 +03:00
Omar Abdulla 9b75a4f236 Update the commit hash of resolc compiler tests 2025-11-03 00:25:56 +03:00
3 changed files with 19 additions and 11 deletions
+14 -2
View File
@@ -234,9 +234,15 @@ impl Platform for ReviveDevNodePolkavmResolcPlatform {
.path
.as_path();
let wallet = AsRef::<WalletConfiguration>::as_ref(&context).wallet();
let working_directory = AsRef::<WorkingDirectoryConfiguration>::as_ref(&context).as_path();
let export_chainspec_command = SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND;
SubstrateNode::node_genesis(revive_dev_node_path, export_chainspec_command, &wallet)
SubstrateNode::node_genesis(
revive_dev_node_path,
export_chainspec_command,
&wallet,
working_directory,
)
}
}
@@ -302,9 +308,15 @@ impl Platform for ReviveDevNodeRevmSolcPlatform {
.path
.as_path();
let wallet = AsRef::<WalletConfiguration>::as_ref(&context).wallet();
let working_directory = AsRef::<WorkingDirectoryConfiguration>::as_ref(&context).as_path();
let export_chainspec_command = SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND;
SubstrateNode::node_genesis(revive_dev_node_path, export_chainspec_command, &wallet)
SubstrateNode::node_genesis(
revive_dev_node_path,
export_chainspec_command,
&wallet,
working_directory,
)
}
}
@@ -160,6 +160,7 @@ impl SubstrateNode {
&self.node_binary,
&self.export_chainspec_command,
&self.wallet,
self.base_directory.as_path(),
)
.context("Failed to prepare the chainspec command")?;
@@ -319,6 +320,7 @@ impl SubstrateNode {
node_path: &Path,
export_chainspec_command: &str,
wallet: &EthereumWallet,
base_directory: impl AsRef<Path>,
) -> anyhow::Result<serde_json::Value> {
trace!("Exporting the chainspec");
let output = Command::new(node_path)
@@ -326,6 +328,7 @@ impl SubstrateNode {
.arg("--chain")
.arg("dev")
.env_remove("RUST_LOG")
.current_dir(base_directory)
.output()
.context("Failed to export the chain-spec")?;
+2 -9
View File
@@ -2,13 +2,12 @@
use std::{
collections::HashMap,
str::FromStr,
sync::{LazyLock, Mutex},
};
use revive_dt_common::types::VersionOrRequirement;
use semver::{Version, VersionReq};
use semver::Version;
use sha2::{Digest, Sha256};
use crate::list::List;
@@ -66,9 +65,6 @@ impl SolcDownloader {
target: &'static str,
list: &'static str,
) -> 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();
match version_or_requirement {
VersionOrRequirement::Version(version) => Ok(Self {
@@ -83,10 +79,7 @@ impl SolcDownloader {
.builds
.into_iter()
.map(|build| build.version)
.filter(|version| {
MAXIMUM_COMPILER_VERSION_REQUIREMENT.matches(version)
&& requirement.matches(version)
})
.filter(|version| requirement.matches(version))
.max()
else {
anyhow::bail!("Failed to find a version that satisfies {requirement:?}");