git.delta.rocks / unique-network / refs/commits / e5f3450abd04

difftreelog

Merge branch 'feature/appPromoReservationBalance' of https://github.com/UniqueNetwork/unique-chain into feature/appPromoReservationBalance

PraetorP2023-01-31parents: #8855177 #f63b0c2.patch.diff
in: master

1 file changed

modifiedtests/src/sub/appPromotion/appPromotion.test.tsdiffbeforeafterboth
95 const staker = accounts.pop()!;95 const staker = accounts.pop()!;
9696
97 // Can't stake full balance because Alice needs to pay some fee97 // Can't stake full balance because Alice needs to pay some fee
98 await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.rejected;98 await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.rejected; // With('Arithmetic')
99 await helper.staking.stake(staker, 500n * nominal);99 await helper.staking.stake(staker, 500n * nominal);
100100
101 // Can't stake 500 tkn because Alice has Less than 500 transferable;101 // Can't stake 500 tkn because Alice has Less than 500 transferable;
102 await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');102 await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejected; // With('Arithmetic');
103 expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal);103 expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal);
104 });104 });
105105
123123
124 // Right after unstake balance is reserved124 // Right after unstake balance is reserved
125 // Staker can not transfer125 // Staker can not transfer
126 expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n});126 expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 900n * nominal, feeFrozen: 900n * nominal});
127 await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejectedWith('balances.InsufficientBalance');127 await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');
128 expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal);128 expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal);
129 expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);129 expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
130 expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore);130 expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore);
171 expect(stakes).to.be.deep.equal([]);171 expect(stakes).to.be.deep.equal([]);
172 expect(pendingUnstake[0].amount).to.equal(600n * nominal);172 expect(pendingUnstake[0].amount).to.equal(600n * nominal);
173173
174 expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n});174 expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 600n * nominal, miscFrozen: 600n * nominal});
175 expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
175 await helper.wait.forParachainBlockNumber(pendingUnstake[0].block);176 await helper.wait.forParachainBlockNumber(pendingUnstake[0].block);
176 expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n});177 expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n});
177 expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);178 expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);