Skip to content

Commit

Permalink
feat: increment block time for RandomlySampled
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoparallel committed Sep 7, 2023
1 parent c7b1151 commit 8deb185
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arbiter-core/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ impl Environment {
let mut transactions_per_block = seeded_poisson
.clone()
.map(|mut distribution| distribution.sample());

let time_step = seeded_poisson
.clone()
.map(|distribution| distribution.time_step);
let mut counter: usize = 0;

// Loop over the reception of calls/transactions sent through the socket
Expand Down Expand Up @@ -344,6 +346,9 @@ impl Environment {
counter = 0;
evm.env.block.number += U256::from(1);

// This unwrap cannot fail.
evm.env.block.timestamp += U256::from(time_step.unwrap());

// This unwrap cannot fail.
transactions_per_block =
Some(seeded_poisson.clone().unwrap().sample());
Expand Down

0 comments on commit 8deb185

Please sign in to comment.