1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::generate_traffic;
use forge::{NetworkContext, NetworkTest, Result, Test};
use tokio::time::Duration;
pub struct NonZeroGasPrice;
impl Test for NonZeroGasPrice {
fn name(&self) -> &'static str {
"gas-price-unit-1"
}
}
impl NetworkTest for NonZeroGasPrice {
fn run<'t>(&self, ctx: &mut NetworkContext<'t>) -> Result<()> {
let duration = Duration::from_secs(240);
let all_validators = ctx
.swarm()
.validators()
.map(|v| v.peer_id())
.collect::<Vec<_>>();
let txn_stat = generate_traffic(ctx, &all_validators, duration, 1, None)?;
ctx.report
.report_txn_stats(self.name().to_string(), txn_stat, duration);
Ok(())
}
}