difftreelog
Merge branch 'feature/appPromoReservationBalance' of https://github.com/UniqueNetwork/unique-chain into feature/appPromoReservationBalance
in: master
1 file changed
tests/src/sub/appPromotion/appPromotion.test.tsdiffbeforeafterboth95 const staker = accounts.pop()!;95 const staker = accounts.pop()!;969697 // Can't stake full balance because Alice needs to pay some fee97 // Can't stake full balance because Alice needs to pay some fee98 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);100100101 // 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 });105105123123124 // Right after unstake balance is reserved124 // Right after unstake balance is reserved125 // Staker can not transfer125 // Staker can not transfer126 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);173173174 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);