From 2dca7cfb29bf62853753dbe19c1b263232e49710 Mon Sep 17 00:00:00 2001 From: arunjot12 Date: Thu, 12 Sep 2024 09:35:39 +0530 Subject: [PATCH] fix: test cases after implementing migration in reward --- frame/reward/src/tests.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frame/reward/src/tests.rs b/frame/reward/src/tests.rs index 3626890..7740cae 100644 --- a/frame/reward/src/tests.rs +++ b/frame/reward/src/tests.rs @@ -1,6 +1,6 @@ use crate::mock::*; use crate::Error; -use crate::{Rewards,ValidatorRewardAccounts,NominatorRewardAccounts,EraReward}; +use crate::{Rewards,ValidatorRewardAccounts,NominatorEarningsAccount,EraReward}; use frame_support::{assert_ok, assert_noop}; use frame_support::traits::Currency; use frame_system::Event; @@ -78,7 +78,7 @@ fn nominator_receiving_reward() { let earlier_validator_balance =RewardBalance::free_balance(VALIDATOR); ValidatorRewardAccounts::::insert(VALIDATOR, validator_reward); - NominatorRewardAccounts::::insert(VALIDATOR, NOMINATOR, nominator_reward); + NominatorEarningsAccount::::insert(VALIDATOR, NOMINATOR, nominator_reward); EraReward::::insert(VALIDATOR,vec![NOMINATOR]); let _ = Balances::deposit_creating(&Reward::account_id(), 15000000); @@ -120,7 +120,7 @@ fn accumulated_rewards_over_multiple_eras() { ValidatorRewardAccounts::::mutate(VALIDATOR.clone(), |earlier_reward| { *earlier_reward += validator_reward; }); - NominatorRewardAccounts::::mutate(VALIDATOR.clone(), NOMINATOR,|earlier_reward| { + NominatorEarningsAccount::::mutate(VALIDATOR.clone(), NOMINATOR,|earlier_reward| { *earlier_reward += nominator_reward; }); EraReward::::insert(VALIDATOR, vec![NOMINATOR]); @@ -149,9 +149,9 @@ fn balance_low_before_distributing() { let nominator_reward3: u128 = 200; ValidatorRewardAccounts::::insert(VALIDATOR, validator_reward); - NominatorRewardAccounts::::insert(VALIDATOR, NOMINATOR, nominator_reward1); - NominatorRewardAccounts::::insert(VALIDATOR, NOMINATOR + 1, nominator_reward2); - NominatorRewardAccounts::::insert(VALIDATOR, NOMINATOR + 2, nominator_reward3); + NominatorEarningsAccount::::insert(VALIDATOR, NOMINATOR, nominator_reward1); + NominatorEarningsAccount::::insert(VALIDATOR, NOMINATOR + 1, nominator_reward2); + NominatorEarningsAccount::::insert(VALIDATOR, NOMINATOR + 2, nominator_reward3); EraReward::::insert(VALIDATOR, vec![NOMINATOR, NOMINATOR + 1, NOMINATOR + 2]); let _ = Balances::deposit_creating(&Reward::account_id(), 1000);