Skip to content

Commit

Permalink
try to fix path issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienFT committed Feb 4, 2025
1 parent f3e7642 commit ce7d901
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions benches/src/bin/high_tps_public_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ fn main() {
// spin up node
let block = rt.block_on({
let transactions = transactions.clone();
let chain_conf = chain_conf.clone();
async move {
test_builder.set_chain_config(chain_conf);
// start the producer node
let TestContext { srv, client, .. } = test_builder.finalize().await;

Expand Down Expand Up @@ -318,6 +320,7 @@ fn main() {
}

rt.block_on(async move {
test_builder.set_chain_config(chain_conf.clone());
let TestContext { srv, .. } = test_builder.finalize().await;

let start = std::time::Instant::now();
Expand Down
9 changes: 8 additions & 1 deletion tests/test-helpers/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pub struct TestSetupBuilder {
#[cfg(feature = "parallel-executor")]
pub executor_number_of_cores: usize,
pub state_rewind_policy: Option<StateRewindPolicy>,
pub chain_config: Option<ChainConfig>,
}

impl TestSetupBuilder {
Expand Down Expand Up @@ -195,9 +196,14 @@ impl TestSetupBuilder {
self
}

pub fn set_chain_config(&mut self, chain_config: ChainConfig) -> &mut Self {
self.chain_config = Some(chain_config);
self
}

// setup chainspec and spin up a fuel-node
pub async fn finalize(&mut self) -> TestContext {
let mut chain_conf = local_chain_config();
let mut chain_conf = self.chain_config.clone().unwrap_or_else(|| local_chain_config());

if let Some(gas_limit) = self.gas_limit {
let tx_params = *chain_conf.consensus_parameters.tx_params();
Expand Down Expand Up @@ -297,6 +303,7 @@ impl Default for TestSetupBuilder {
#[cfg(feature = "parallel-executor")]
executor_number_of_cores: 1,
state_rewind_policy: None,
chain_config: None
}
}
}
Expand Down

0 comments on commit ce7d901

Please sign in to comment.