Skip to content

Commit

Permalink
add some minimal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guibescos committed Sep 13, 2024
1 parent 83cfe23 commit 95b98a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions staking/integration-tests/tests/publisher_caps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ fn test_close_publisher_caps() {
let publisher_caps =
post_dummy_publisher_caps(&mut svm, &payer, publisher_keypair.pubkey(), 10);

assert!(svm.get_account(&publisher_caps).unwrap().lamports > 0);
let payer_balance_before = svm.get_account(&payer.pubkey()).unwrap().lamports;

assert_anchor_program_error!(
close_publisher_caps(&mut svm, &Keypair::new(), &payer, publisher_caps),
PublisherCapsError::WrongWriteAuthority,
Expand All @@ -47,4 +50,6 @@ fn test_close_publisher_caps() {
close_publisher_caps(&mut svm, &payer, &payer, publisher_caps).unwrap();
assert_eq!(svm.get_account(&publisher_caps).unwrap().data.len(), 0);
assert_eq!(svm.get_account(&publisher_caps).unwrap().lamports, 0);

assert!(svm.get_account(&payer.pubkey()).unwrap().lamports > payer_balance_before);
}

0 comments on commit 95b98a2

Please sign in to comment.