Skip to content

Commit

Permalink
Refactor balance selector to handle strings (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbodnar committed May 17, 2021
1 parent fda0ec5 commit d76dfd4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/reducers/selectors/balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export const selectProfileBalance = (balance) => {
const lockupIdExists = !!lockedAmount

const walletBalance = {
walletBalance: stakedBalanceMainAccount.add(new BN(balanceAvailable)).add(new BN(stateStaked)).toString(),
reservedForStorage: stateStaked.toString(),
walletBalance: new BN(stakedBalanceMainAccount).add(new BN(balanceAvailable)).add(new BN(stateStaked)).toString(),
reservedForStorage: stateStaked,
inStakingPools: {
sum: stakedBalanceMainAccount.toString(),
sum: stakedBalanceMainAccount,
staked: account?.totalStaked,
pendingRelease: account?.totalPending,
availableForWithdraw: account?.totalAvailable
Expand All @@ -41,18 +41,18 @@ export const selectProfileBalance = (balance) => {
} = balance

lockupBalance = {
lockupBalance: totalBalance.toString(),
lockupBalance: totalBalance,
reservedForStorage: LOCKUP_MIN_BALANCE.toString(),
inStakingPools: {
sum: stakedBalanceLockup.toString(),
sum: stakedBalanceLockup,
staked: lockupAccount?.totalStaked,
pendingRelease: lockupAccount?.totalPending && new BN(lockupAccount.totalPending).toString(),
availableForWithdraw: lockupAccount?.totalAvailable && new BN(lockupAccount.totalAvailable).toString()
},
locked: lockedAmount.toString(),
locked: lockedAmount,
unlocked: {
sum: ownersBalance.toString(),
availableToTransfer: liquidOwnersBalance.toString()
sum: ownersBalance,
availableToTransfer: liquidOwnersBalance
}
}
}
Expand Down

0 comments on commit d76dfd4

Please sign in to comment.