Skip to content

Commit

Permalink
update integration tests with count requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill-K-1 committed Nov 13, 2024
1 parent 3a2a023 commit 4068008
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions gov-portal-db/tests/test_rewards_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ async fn test_rewards_endpoint() -> Result<(), anyhow::Error> {
Err(error::Error::Unauthorized)
);

assert_eq!(
rewards_manager
.count_rewards(&Address::from_low_u64_le(1_234_567), None, None, None)
.await
.unwrap(),
10
);

assert!(rewards_manager
.get_rewards_by_wallet(
&Address::from_low_u64_le(1),
Expand Down Expand Up @@ -464,6 +472,18 @@ async fn test_rewards_by_wallet() -> Result<(), anyhow::Error> {
1
);

let total = rewards_manager
.count_rewards_by_wallet(
&Address::from_low_u64_le(1),
&Address::from_low_u64_le(1),
Some(now + 2 * 4 * 60 * 60 + 1),
None,
None,
)
.await
.unwrap();
assert_eq!(total, 58);

assert_eq!(
rewards_manager
.get_rewards_by_wallet(
Expand Down

0 comments on commit 4068008

Please sign in to comment.