Skip to content

Commit e4717b9

Browse files
committed
refactor(e2e): rename wait_for_* methods to improve readability and consistency
Has those functions are in the `WaitContext` we do not need to repeat `wait_` in their names.
1 parent fde8e61 commit e4717b9

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

mithril-test-lab/mithril-end-to-end/src/scenario/full.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ impl FullScenario {
113113
) -> StdResult<()> {
114114
let leader_aggregator = infrastructure.leader_aggregator();
115115

116-
self.toolkit.wait.wait_for_enough_immutable(leader_aggregator).await?;
116+
self.toolkit.wait.for_enough_immutable(leader_aggregator).await?;
117117
let chain_observer = leader_aggregator.chain_observer();
118118
let start_epoch = chain_observer.get_current_epoch().await?.unwrap_or_default();
119119

120120
// Wait 4 epochs after start epoch for the aggregator to be able to bootstrap a genesis certificate
121121
let mut target_epoch = start_epoch + 4;
122122
self.toolkit
123123
.wait
124-
.wait_for_aggregator_at_target_epoch(
124+
.for_aggregator_at_target_epoch(
125125
leader_aggregator,
126126
target_epoch,
127127
"minimal epoch for the aggregator to be able to bootstrap genesis certificate"
@@ -132,13 +132,13 @@ impl FullScenario {
132132
.exec
133133
.bootstrap_genesis_certificate(leader_aggregator)
134134
.await?;
135-
self.toolkit.wait.wait_for_epoch_settings(leader_aggregator).await?;
135+
self.toolkit.wait.for_epoch_settings(leader_aggregator).await?;
136136

137137
// Wait 2 epochs before changing stake distribution, so that we use at least one original stake distribution
138138
target_epoch += 2;
139139
self.toolkit
140140
.wait
141-
.wait_for_aggregator_at_target_epoch(
141+
.for_aggregator_at_target_epoch(
142142
leader_aggregator,
143143
target_epoch,
144144
"epoch after which the stake distribution will change".to_string(),
@@ -167,7 +167,7 @@ impl FullScenario {
167167
let mut target_epoch = start_epoch + 2;
168168
self.toolkit
169169
.wait
170-
.wait_for_aggregator_at_target_epoch(
170+
.for_aggregator_at_target_epoch(
171171
aggregator,
172172
target_epoch,
173173
"epoch after which the protocol parameters will change".to_string(),
@@ -183,7 +183,7 @@ impl FullScenario {
183183

184184
// Wait 6 epochs after protocol parameters update, so that we make sure that we use new protocol parameters as well as new stake distribution a few times
185185
target_epoch += 6;
186-
self.toolkit.wait.wait_for_aggregator_at_target_epoch(
186+
self.toolkit.wait.for_aggregator_at_target_epoch(
187187
aggregator,
188188
target_epoch,
189189
"epoch after which the certificate chain will be long enough to catch most common troubles with stake distribution and protocol parameters".to_string(),
@@ -204,7 +204,7 @@ impl FullScenario {
204204
target_epoch += 5;
205205
self.toolkit
206206
.wait
207-
.wait_for_aggregator_at_target_epoch(
207+
.for_aggregator_at_target_epoch(
208208
aggregator,
209209
target_epoch,
210210
"epoch after which the era switch will have triggered".to_string(),
@@ -217,7 +217,7 @@ impl FullScenario {
217217
target_epoch += 5;
218218
self.toolkit
219219
.wait
220-
.wait_for_aggregator_at_target_epoch(
220+
.for_aggregator_at_target_epoch(
221221
aggregator,
222222
target_epoch,
223223
"epoch after which the re-genesis on era switch will be completed"

mithril-test-lab/mithril-end-to-end/src/scenario/run_only.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ impl RunOnlyScenario {
3838
) -> StdResult<()> {
3939
let leader_aggregator = infrastructure.leader_aggregator();
4040

41-
self.toolkit.wait.wait_for_enough_immutable(leader_aggregator).await?;
41+
self.toolkit.wait.for_enough_immutable(leader_aggregator).await?;
4242
let chain_observer = leader_aggregator.chain_observer();
4343
let start_epoch = chain_observer.get_current_epoch().await?.unwrap_or_default();
4444

4545
// Wait 3 epochs after start epoch for the aggregator to be able to bootstrap a genesis certificate
4646
let target_epoch = start_epoch + 3;
4747
self.toolkit
4848
.wait
49-
.wait_for_aggregator_at_target_epoch(
49+
.for_aggregator_at_target_epoch(
5050
leader_aggregator,
5151
target_epoch,
5252
"minimal epoch for the aggregator to be able to bootstrap genesis certificate"
@@ -57,7 +57,7 @@ impl RunOnlyScenario {
5757
.exec
5858
.bootstrap_genesis_certificate(leader_aggregator)
5959
.await?;
60-
self.toolkit.wait.wait_for_epoch_settings(leader_aggregator).await?;
60+
self.toolkit.wait.for_epoch_settings(leader_aggregator).await?;
6161

6262
// Transfer some funds on the devnet to have some Cardano transactions to sign
6363
self.toolkit.exec.transfer_funds(infrastructure.devnet()).await?;

mithril-test-lab/mithril-end-to-end/src/toolkit/wait.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl WaitToolkit {
1717
Self { context }
1818
}
1919

20-
pub async fn wait_for_enough_immutable(&self, aggregator: &Aggregator) -> StdResult<()> {
20+
pub async fn for_enough_immutable(&self, aggregator: &Aggregator) -> StdResult<()> {
2121
info!("Waiting that enough immutable have been written in the devnet"; "aggregator" => aggregator.name());
2222

2323
let db_directory = aggregator.db_directory();
@@ -44,7 +44,7 @@ impl WaitToolkit {
4444
}
4545
}
4646

47-
pub async fn wait_for_epoch_settings(
47+
pub async fn for_epoch_settings(
4848
&self,
4949
aggregator: &Aggregator,
5050
) -> StdResult<EpochSettingsMessage> {
@@ -80,7 +80,7 @@ impl WaitToolkit {
8080
}
8181
}
8282

83-
pub async fn wait_for_aggregator_at_target_epoch(
83+
pub async fn for_aggregator_at_target_epoch(
8484
&self,
8585
aggregator: &Aggregator,
8686
target_epoch: Epoch,

0 commit comments

Comments
 (0)