Rename the state and driver

This commit is contained in:
Omar Abdulla
2025-07-31 17:16:57 +03:00
parent 989c064983
commit 01e31a4333
2 changed files with 11 additions and 11 deletions
+7 -7
View File
@@ -37,7 +37,7 @@ use revive_dt_report::reporter::{CompilationTask, Report, Span};
use crate::Platform; use crate::Platform;
pub struct State<'a, T: Platform> { pub struct CaseState<'a, T: Platform> {
/// The configuration that the framework was started with. /// The configuration that the framework was started with.
/// ///
/// This is currently used to get certain information from it such as the solc mode and other /// This is currently used to get certain information from it such as the solc mode and other
@@ -71,7 +71,7 @@ pub struct State<'a, T: Platform> {
phantom: PhantomData<T>, phantom: PhantomData<T>,
} }
impl<'a, T> State<'a, T> impl<'a, T> CaseState<'a, T>
where where
T: Platform, T: Platform,
{ {
@@ -731,7 +731,7 @@ where
} }
} }
pub struct Driver<'a, Leader: Platform, Follower: Platform> { pub struct CaseDriver<'a, Leader: Platform, Follower: Platform> {
metadata: &'a Metadata, metadata: &'a Metadata,
case: &'a Case, case: &'a Case,
case_idx: CaseIdx, case_idx: CaseIdx,
@@ -740,7 +740,7 @@ pub struct Driver<'a, Leader: Platform, Follower: Platform> {
follower_node: &'a Follower::Blockchain, follower_node: &'a Follower::Blockchain,
} }
impl<'a, L, F> Driver<'a, L, F> impl<'a, L, F> CaseDriver<'a, L, F>
where where
L: Platform, L: Platform,
F: Platform, F: Platform,
@@ -752,7 +752,7 @@ where
config: &'a Arguments, config: &'a Arguments,
leader_node: &'a L::Blockchain, leader_node: &'a L::Blockchain,
follower_node: &'a F::Blockchain, follower_node: &'a F::Blockchain,
) -> Driver<'a, L, F> { ) -> CaseDriver<'a, L, F> {
Self { Self {
metadata, metadata,
case, case,
@@ -838,8 +838,8 @@ where
let tracing_span = tracing::info_span!("With solc mode", solc_mode = ?mode); let tracing_span = tracing::info_span!("With solc mode", solc_mode = ?mode);
let _guard = tracing_span.enter(); let _guard = tracing_span.enter();
let mut leader_state = State::<L>::new(self.config, span); let mut leader_state = CaseState::<L>::new(self.config, span);
let mut follower_state = State::<F>::new(self.config, span); let mut follower_state = CaseState::<F>::new(self.config, span);
// Note: we are currently forced to do two compilation passes due to linking. In the // Note: we are currently forced to do two compilation passes due to linking. In the
// first compilation pass we compile the libraries and publish them to the chain. In the // first compilation pass we compile the libraries and publish them to the chain. In the
+4 -4
View File
@@ -6,7 +6,7 @@ use rayon::{ThreadPoolBuilder, prelude::*};
use revive_dt_config::*; use revive_dt_config::*;
use revive_dt_core::{ use revive_dt_core::{
Geth, Kitchensink, Platform, Geth, Kitchensink, Platform,
driver::{Driver, State}, driver::{CaseDriver, CaseState},
}; };
use revive_dt_format::{corpus::Corpus, metadata::MetadataFile}; use revive_dt_format::{corpus::Corpus, metadata::MetadataFile};
use revive_dt_node::pool::NodePool; use revive_dt_node::pool::NodePool;
@@ -119,7 +119,7 @@ where
); );
let _guard = tracing_span.enter(); let _guard = tracing_span.enter();
let mut driver = Driver::<L, F>::new( let mut driver = CaseDriver::<L, F>::new(
metadata, metadata,
case, case,
case_idx, case_idx,
@@ -176,11 +176,11 @@ fn compile_corpus(
for mode in &metadata.solc_modes() { for mode in &metadata.solc_modes() {
match platform { match platform {
TestingPlatform::Geth => { TestingPlatform::Geth => {
let mut state = State::<Geth>::new(config, span); let mut state = CaseState::<Geth>::new(config, span);
let _ = state.build_contracts(mode, metadata); let _ = state.build_contracts(mode, metadata);
} }
TestingPlatform::Kitchensink => { TestingPlatform::Kitchensink => {
let mut state = State::<Kitchensink>::new(config, span); let mut state = CaseState::<Kitchensink>::new(config, span);
let _ = state.build_contracts(mode, metadata); let _ = state.build_contracts(mode, metadata);
} }
}; };