From e2c0f8fbe2dcc5b3696def23c1d2cb2d5f2052e5 Mon Sep 17 00:00:00 2001 From: nahem Date: Fri, 12 Jul 2024 11:04:32 +0200 Subject: [PATCH] fix: WIP in integration tests --- integration-tests/tests/integration.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/integration-tests/tests/integration.rs b/integration-tests/tests/integration.rs index 4d2b80ef..e8b5594f 100644 --- a/integration-tests/tests/integration.rs +++ b/integration-tests/tests/integration.rs @@ -293,8 +293,10 @@ proptest! { let bonded_amounts = bonded_amounts.borrow(); println!(">>> [{current_epoch}] BONDED AMOUNTS {:?}", bonded_amounts); - for user in bonded_amounts.keys() { - claimable_rewards.borrow_mut().insert((user.clone(), current_epoch), true); + for (user, token_amounts) in bonded_amounts.iter() { + if token_amounts.values().any(|&amount| amount > 0) { + claimable_rewards.borrow_mut().insert((user.clone(), current_epoch), true); + } } } else { suite.swap( @@ -449,14 +451,14 @@ proptest! { } } - // suite.query_bonding_rewards(user.to_string(), |response| { - // let contract_rewards = &response.as_ref().unwrap().1.rewards; - // let has_contract_rewards = !contract_rewards.is_empty(); - // println!(">>>"); - // println!(">>> [{current_epoch}] CLAIMABLE REWARDS CONTRACT {:?}", contract_rewards); - // println!(">>> [{current_epoch}] CLAIMABLE REWARDS PROPTEST {:?}", claimable_rewards.borrow()); - // assert_eq!(has_pending_rewards, has_contract_rewards); - // }); + suite.query_bonding_rewards(user.to_string(), |response| { + let contract_rewards = &response.as_ref().unwrap().1.rewards; + let has_contract_rewards = !contract_rewards.is_empty(); + println!(">>>"); + println!(">>> [{current_epoch}] CLAIMABLE REWARDS CONTRACT {:?}", contract_rewards); + println!(">>> [{current_epoch}] CLAIMABLE REWARDS PROPTEST {:?}", claimable_rewards.borrow()); + // assert_eq!(has_pending_rewards, has_contract_rewards); + }); if has_pending_rewards { println!(">>> [{current_epoch}] [{user}] CLAIM");