mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-07-17 14:35:42 +00:00
Add more identifiers to the platform
This commit is contained in:
Generated
+2
@@ -4468,10 +4468,12 @@ name = "revive-dt-common"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
"clap",
|
||||||
"moka",
|
"moka",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"semver 1.0.26",
|
"semver 1.0.26",
|
||||||
"serde",
|
"serde",
|
||||||
|
"strum",
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ rust-version.workspace = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
|
clap = { workspace = true }
|
||||||
moka = { workspace = true, features = ["sync"] }
|
moka = { workspace = true, features = ["sync"] }
|
||||||
once_cell = { workspace = true }
|
once_cell = { workspace = true }
|
||||||
semver = { workspace = true }
|
semver = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
|
strum = { workspace = true }
|
||||||
tokio = { workspace = true, default-features = false, features = ["time"] }
|
tokio = { workspace = true, default-features = false, features = ["time"] }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
use clap::ValueEnum;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use strum::{AsRefStr, Display, EnumString, IntoStaticStr};
|
||||||
|
|
||||||
|
/// An enum of the platform identifiers of all of the platforms supported by this framework.
|
||||||
|
#[derive(
|
||||||
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
PartialEq,
|
||||||
|
Eq,
|
||||||
|
PartialOrd,
|
||||||
|
Ord,
|
||||||
|
Hash,
|
||||||
|
Serialize,
|
||||||
|
Deserialize,
|
||||||
|
ValueEnum,
|
||||||
|
EnumString,
|
||||||
|
Display,
|
||||||
|
AsRefStr,
|
||||||
|
IntoStaticStr,
|
||||||
|
)]
|
||||||
|
#[serde(rename = "kebab-case")]
|
||||||
|
#[strum(serialize_all = "kebab-case")]
|
||||||
|
pub enum PlatformIdentifier {
|
||||||
|
/// The Go-ethereum reference full node EVM implementation.
|
||||||
|
GethEvm,
|
||||||
|
/// The kitchensink node with the PolkaVM backend.
|
||||||
|
KitchensinkPolkaVM,
|
||||||
|
/// The kitchensink node with the REVM backend.
|
||||||
|
KitchensinkREVM,
|
||||||
|
/// The revive dev node with the PolkaVM backend.
|
||||||
|
ReviveDevNodePolkaVM,
|
||||||
|
/// The revive dev node with the REVM backend.
|
||||||
|
ReviveDevNodeREVM,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// An enum of the platform identifiers of all of the platforms supported by this framework.
|
||||||
|
#[derive(
|
||||||
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
PartialEq,
|
||||||
|
Eq,
|
||||||
|
PartialOrd,
|
||||||
|
Ord,
|
||||||
|
Hash,
|
||||||
|
Serialize,
|
||||||
|
Deserialize,
|
||||||
|
ValueEnum,
|
||||||
|
EnumString,
|
||||||
|
Display,
|
||||||
|
AsRefStr,
|
||||||
|
IntoStaticStr,
|
||||||
|
)]
|
||||||
|
#[serde(rename = "kebab-case")]
|
||||||
|
#[strum(serialize_all = "kebab-case")]
|
||||||
|
pub enum CompilerIdentifier {
|
||||||
|
/// The solc compiler.
|
||||||
|
Solc,
|
||||||
|
/// The resolc compiler.
|
||||||
|
Resolc,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// An enum representing the identifiers of the supported nodes.
|
||||||
|
#[derive(
|
||||||
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
PartialEq,
|
||||||
|
Eq,
|
||||||
|
PartialOrd,
|
||||||
|
Ord,
|
||||||
|
Hash,
|
||||||
|
Serialize,
|
||||||
|
Deserialize,
|
||||||
|
ValueEnum,
|
||||||
|
EnumString,
|
||||||
|
Display,
|
||||||
|
AsRefStr,
|
||||||
|
IntoStaticStr,
|
||||||
|
)]
|
||||||
|
#[serde(rename = "kebab-case")]
|
||||||
|
#[strum(serialize_all = "kebab-case")]
|
||||||
|
pub enum NodeIdentifier {
|
||||||
|
/// The go-ethereum node implementation.
|
||||||
|
Geth,
|
||||||
|
/// The Kitchensink node implementation.
|
||||||
|
Kitchensink,
|
||||||
|
/// The revive dev node implementation.
|
||||||
|
ReviveDevNode,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// An enum representing the identifiers of the supported VMs.
|
||||||
|
#[derive(
|
||||||
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
PartialEq,
|
||||||
|
Eq,
|
||||||
|
PartialOrd,
|
||||||
|
Ord,
|
||||||
|
Hash,
|
||||||
|
Serialize,
|
||||||
|
Deserialize,
|
||||||
|
ValueEnum,
|
||||||
|
EnumString,
|
||||||
|
Display,
|
||||||
|
AsRefStr,
|
||||||
|
IntoStaticStr,
|
||||||
|
)]
|
||||||
|
#[serde(rename = "kebab-case")]
|
||||||
|
#[strum(serialize_all = "kebab-case")]
|
||||||
|
pub enum VmIdentifier {
|
||||||
|
/// The ethereum virtual machine.
|
||||||
|
Evm,
|
||||||
|
/// Polkadot's PolaVM Risc-v based virtual machine.
|
||||||
|
PolkaVm,
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
mod identifiers;
|
||||||
mod mode;
|
mod mode;
|
||||||
mod version_or_requirement;
|
mod version_or_requirement;
|
||||||
|
|
||||||
|
pub use identifiers::*;
|
||||||
pub use mode::*;
|
pub use mode::*;
|
||||||
pub use version_or_requirement::*;
|
pub use version_or_requirement::*;
|
||||||
|
|||||||
@@ -564,34 +564,3 @@ pub enum TestingPlatform {
|
|||||||
/// The kitchensink runtime provides the PolkaVM (PVM) based node implementation.
|
/// The kitchensink runtime provides the PolkaVM (PVM) based node implementation.
|
||||||
Kitchensink,
|
Kitchensink,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An enum of the platform identifiers of all of the platforms supported by this framework.
|
|
||||||
#[derive(
|
|
||||||
Clone,
|
|
||||||
Copy,
|
|
||||||
Debug,
|
|
||||||
PartialEq,
|
|
||||||
Eq,
|
|
||||||
PartialOrd,
|
|
||||||
Ord,
|
|
||||||
Hash,
|
|
||||||
Serialize,
|
|
||||||
ValueEnum,
|
|
||||||
EnumString,
|
|
||||||
Display,
|
|
||||||
AsRefStr,
|
|
||||||
IntoStaticStr,
|
|
||||||
)]
|
|
||||||
#[strum(serialize_all = "kebab-case")]
|
|
||||||
pub enum PlatformIdentifier {
|
|
||||||
/// The Go-ethereum reference full node EVM implementation.
|
|
||||||
GethEvm,
|
|
||||||
/// The kitchensink node with the PolkaVM backend.
|
|
||||||
KitchensinkPolkaVM,
|
|
||||||
/// The kitchensink node with the REVM backend.
|
|
||||||
KitchensinkREVM,
|
|
||||||
/// The revive dev node with the PolkaVM backend.
|
|
||||||
ReviveDevNodePolkaVM,
|
|
||||||
/// The revive dev node with the REVM backend.
|
|
||||||
ReviveDevNodeREVM,
|
|
||||||
}
|
|
||||||
|
|||||||
+21
-2
@@ -3,7 +3,7 @@
|
|||||||
//! This crate defines the testing configuration and
|
//! This crate defines the testing configuration and
|
||||||
//! provides a helper utility to execute tests.
|
//! provides a helper utility to execute tests.
|
||||||
|
|
||||||
use revive_dt_common::types::VersionOrRequirement;
|
use revive_dt_common::types::*;
|
||||||
use revive_dt_compiler::{DynSolidityCompiler, SolidityCompiler, revive_resolc, solc};
|
use revive_dt_compiler::{DynSolidityCompiler, SolidityCompiler, revive_resolc, solc};
|
||||||
use revive_dt_config::*;
|
use revive_dt_config::*;
|
||||||
use revive_dt_format::traits::ResolverApi;
|
use revive_dt_format::traits::ResolverApi;
|
||||||
@@ -49,9 +49,28 @@ impl Platform for Kitchensink {
|
|||||||
|
|
||||||
/// A trait that describes the interface for the platforms that are supported by the tool.
|
/// A trait that describes the interface for the platforms that are supported by the tool.
|
||||||
pub trait DynPlatform {
|
pub trait DynPlatform {
|
||||||
/// Returns the identifier of this platform.
|
/// Returns the identifier of this platform. This is a combination of the node and the compiler
|
||||||
|
/// used.
|
||||||
fn platform_identifier(&self) -> PlatformIdentifier;
|
fn platform_identifier(&self) -> PlatformIdentifier;
|
||||||
|
|
||||||
|
/// Returns a full identifier for the platform.
|
||||||
|
fn full_identifier(&self) -> (NodeIdentifier, VmIdentifier, CompilerIdentifier) {
|
||||||
|
(
|
||||||
|
self.node_identifier(),
|
||||||
|
self.vm_identifier(),
|
||||||
|
self.compiler_identifier(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the identifier of the node used.
|
||||||
|
fn node_identifier(&self) -> NodeIdentifier;
|
||||||
|
|
||||||
|
/// Returns the identifier of the vm used.
|
||||||
|
fn vm_identifier(&self) -> VmIdentifier;
|
||||||
|
|
||||||
|
/// Returns the identifier of the compiler used.
|
||||||
|
fn compiler_identifier(&self) -> CompilerIdentifier;
|
||||||
|
|
||||||
/// Creates a new node for the platform by spawning a new thread, creating the node object,
|
/// Creates a new node for the platform by spawning a new thread, creating the node object,
|
||||||
/// initializing it, spawning it, and waiting for it to start up.
|
/// initializing it, spawning it, and waiting for it to start up.
|
||||||
fn new_node(
|
fn new_node(
|
||||||
|
|||||||
Reference in New Issue
Block a user