Skip to content

Commit 098468d

Browse files
committed
Fix end to end test stake delegation
1 parent 0b25d55 commit 098468d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

mithril-test-lab/mithril-end-to-end/src/assertions/exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub async fn bootstrap_genesis_certificate(aggregator: &mut Aggregator) -> StdRe
1616
Ok(())
1717
}
1818

19-
pub async fn delegate_stakes_to_pools(devnet: &Devnet) -> StdResult<()> {
19+
pub async fn delegate_stakes_to_pools(devnet: &Devnet, delegation_round: u16) -> StdResult<()> {
2020
info!("Delegate stakes to the cardano pools");
2121

22-
devnet.delegate_stakes().await?;
22+
devnet.delegate_stakes(delegation_round).await?;
2323

2424
Ok(())
2525
}

mithril-test-lab/mithril-end-to-end/src/devnet/runner.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,14 @@ impl Devnet {
204204
}
205205
}
206206

207-
pub async fn delegate_stakes(&self) -> StdResult<()> {
207+
pub async fn delegate_stakes(&self, delegation_round: u16) -> StdResult<()> {
208208
let run_script = "delegate.sh";
209209
let run_script_path = self.artifacts_dir.join(run_script);
210210
let mut run_command = Command::new(&run_script_path);
211211
run_command
212212
.current_dir(&self.artifacts_dir)
213213
.kill_on_drop(true);
214+
run_command.env("DELEGATION_ROUND", delegation_round.to_string());
214215

215216
info!("Delegating stakes to the pools"; "script" => &run_script_path.display());
216217

mithril-test-lab/mithril-end-to-end/src/end_to_end_spec.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ impl<'a> Spec<'a> {
4242
"epoch after which the stake distribution will change".to_string(),
4343
)
4444
.await?;
45-
assertions::delegate_stakes_to_pools(self.infrastructure.devnet()).await?;
45+
let delegation_round = 1;
46+
assertions::delegate_stakes_to_pools(self.infrastructure.devnet(), delegation_round)
47+
.await?;
4648

4749
// Wait 2 epochs before changing protocol parameters
4850
target_epoch += 2;

0 commit comments

Comments
 (0)