Skip to content

Commit

Permalink
Fix the hard coded epoch that we need to wait for.
Browse files Browse the repository at this point in the history
Before it waited for a hard coded amount 7, which is not correct. In
reality it should be waiting until 13, seen from this string

Amount 412 withdrawable starting from epoch 13

However even if this changes in the future, this regex will correctly
get it.
  • Loading branch information
mariari committed Jun 28, 2023
1 parent fdeaf23 commit 4ddbb58
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/src/e2e/ledger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2202,7 +2202,7 @@ fn pos_rewards() -> Result<()> {
/// 3. Wait for epoch 4
/// 4. Submit another delegation to the genesis validator
/// 5. Submit an unbond of the delegation
/// 6. Wait for epoch 7
/// 6. Wait for epoch withdraw_epoch
/// 7. Check the output of the bonds query
#[test]
fn test_bond_queries() -> Result<()> {
Expand Down Expand Up @@ -2317,6 +2317,11 @@ fn test_bond_queries() -> Result<()> {
];
let mut client = run!(test, Bin::Client, tx_args, Some(40))?;
client.exp_string("Transaction is valid.")?;
let (_, res) = client
.exp_regex(r"withdrawable starting from epoch [0-9]+")
.unwrap();
let withdraw_epoch =
Epoch::from_str(res.split(' ').last().unwrap()).unwrap();
client.assert_success();

// 6. Wait for epoch 7
Expand All @@ -2327,7 +2332,7 @@ fn test_bond_queries() -> Result<()> {
panic!("Timed out waiting for epoch: {}", 7);
}
let epoch = get_epoch(&test, &validator_one_rpc)?;
if epoch >= Epoch(7) {
if epoch >= withdraw_epoch {
break;
}
}
Expand Down

0 comments on commit 4ddbb58

Please sign in to comment.