From cc721679a9e6606e1c5a3df825488821b9836cff Mon Sep 17 00:00:00 2001 From: jaypan Date: Mon, 11 Nov 2024 09:35:57 +0000 Subject: [PATCH] Fix test --- tests/reward_distribution_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/reward_distribution_test.py b/tests/reward_distribution_test.py index 3000a03..350785e 100644 --- a/tests/reward_distribution_test.py +++ b/tests/reward_distribution_test.py @@ -37,6 +37,8 @@ } } +FORCE_KEEP_POT_BALANCE = 10 + COLLATOR_DELEGATOR_POT = '5EYCAe5cKPAoFh2HnQQvpKqRYZGqBpaA87u4Zzw89qPE58is' DIVISION_FACTOR = pow(10, 7) @@ -149,7 +151,8 @@ def _check_block_reward_in_event(self, kp_collator, first_receipt, second_receip get_account_balance(self._substrate, PARACHAIN_STAKING_POT, second_receipt.block_hash) - \ get_existential_deposit(self._substrate) - self.assertEqual(rewarded_number, pot_transferable_balance) + # Force keep the pot balance to avoid event annoy + self.assertEqual(rewarded_number, pot_transferable_balance - FORCE_KEEP_POT_BALANCE) # Check the block reward + transaction fee (Need to check again...) transaction_fee, transaction_tip = 0, 0 @@ -174,7 +177,7 @@ def _check_block_reward_in_event(self, kp_collator, first_receipt, second_receip # Check all collator reward in collators first_balance = get_account_balance(self._substrate, kp_collator.ss58_address, first_new_session_block_hash) second_balance = get_account_balance(self._substrate, kp_collator.ss58_address, second_new_session_block_hash) - self.assertEqual(second_balance - first_balance, pot_transferable_balance) + self.assertEqual(second_balance - first_balance, pot_transferable_balance - FORCE_KEEP_POT_BALANCE) def _check_transaction_fee_reward_from_sender(self, block_height): block_hash = self._substrate.get_block_hash(block_height)