mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-02-05 05:53:13 +00:00
17 lines
570 B
Rust
17 lines
570 B
Rust
use testing_framework_core::scenario::ScenarioBuilder;
|
|
use testing_framework_workflows::ScenarioBuilderExt;
|
|
|
|
pub fn declarative_over_imperative() {
|
|
// Good: declarative
|
|
let _plan = ScenarioBuilder::topology_with(|t| t.network_star().validators(2).executors(1))
|
|
.transactions_with(|txs| {
|
|
txs.rate(5) // 5 transactions per block
|
|
})
|
|
.expect_consensus_liveness()
|
|
.build();
|
|
|
|
// Bad: imperative (framework doesn't work this way)
|
|
// spawn_validator(); spawn_executor();
|
|
// loop { submit_tx(); check_block(); }
|
|
}
|