Chagne StoredBalance functions to not mutate in place

This commit is contained in:
Michael Zhu
2019-12-12 15:21:42 -08:00
parent a24b293818
commit 8ecbde8e1e
4 changed files with 112 additions and 42 deletions

View File

@@ -54,8 +54,16 @@ export function validStakeAssertion(
balanceStore.assertEquals(expectedBalances);
// _increaseCurrentAndNextBalance
increaseCurrentAndNextBalance(ownerStake[StakeStatus.Undelegated], amount, currentEpoch);
increaseCurrentAndNextBalance(globalStake[StakeStatus.Undelegated], amount, currentEpoch);
ownerStake[StakeStatus.Undelegated] = increaseCurrentAndNextBalance(
ownerStake[StakeStatus.Undelegated],
amount,
currentEpoch,
);
globalStake[StakeStatus.Undelegated] = increaseCurrentAndNextBalance(
globalStake[StakeStatus.Undelegated],
amount,
currentEpoch,
);
// Checks that the owner's undelegated stake has increased by the stake amount
const ownerUndelegatedStake = await stakingWrapper