Skip to content

Commit

Permalink
Test metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
enriquefynn committed Apr 11, 2022
1 parent 1e8a63b commit 69d63f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions anker/tests/tests/deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ async fn test_successful_deposit_during_first_epoch() {
// so the amounts in SOL, stSOL, and bSOL are all equal.
assert_eq!(reserve_balance, TEST_DEPOSIT_AMOUNT);
assert_eq!(recipient_balance, BLamports(TEST_DEPOSIT_AMOUNT.0));
let anker = context.get_anker().await;
assert_eq!(
anker.metrics.deposit_metric.st_sol_total,
TEST_DEPOSIT_AMOUNT
);
assert_eq!(
anker.metrics.deposit_metric.b_sol_total,
BLamports(TEST_DEPOSIT_AMOUNT.0)
);
assert_eq!(anker.metrics.deposit_metric.count, 1);
}

#[tokio::test]
Expand Down
4 changes: 4 additions & 0 deletions anker/tests/tests/withdraw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ async fn test_withdraw_single_epoch() {
.get_st_sol_balance(context.st_sol_reserve)
.await;
assert_eq!(reserve_st_sol, StLamports(0));
let anker = context.get_anker().await;
assert_eq!(anker.metrics.withdraw_metric.st_sol_total, st_sol_balance);
assert_eq!(anker.metrics.withdraw_metric.b_sol_total, b_sol_balance);
assert_eq!(anker.metrics.withdraw_metric.count, 1);
}

#[tokio::test]
Expand Down

0 comments on commit 69d63f3

Please sign in to comment.