Skip to content

Commit

Permalink
Fix erc20 not displaying balance
Browse files Browse the repository at this point in the history
  • Loading branch information
monokh committed Oct 28, 2020
1 parent 0b4d980 commit 3361581
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/store/actions/updateBalances.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Bluebird from 'bluebird'
export const updateBalances = async ({ state, commit, getters }, { network, walletId }) => {
const assets = state.enabledAssets[network][walletId]

return Bluebird.map(assets, async asset => {
await Bluebird.map(assets, async asset => {
const addresses = await getters.client(network, walletId, asset).wallet.getUsedAddresses()
const balance = addresses.length === 0
? 0
Expand Down
12 changes: 2 additions & 10 deletions src/utils/coinFormatter.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import BN from 'bignumber.js'
import cryptoassets from '@liquality/cryptoassets'

const DP_UI_MAP = {
BTC: 6,
ETH: 6,
DAI: 6,
USDC: 6,
USDT: 6,
WBTC: 6,
UNI: 6
}
const VALUE_DECIMALS = 6

export const dp = (amount, coin) => {
if (!amount) return amount
Expand All @@ -20,7 +12,7 @@ export const dp = (amount, coin) => {
export const dpUI = (amount, coin) => {
if (!amount) return amount

return BN(amount).dp(DP_UI_MAP[coin], BN.ROUND_FLOOR)
return BN(amount).dp(VALUE_DECIMALS, BN.ROUND_FLOOR)
}

export const prettyBalance = (amount, coin) => {
Expand Down

0 comments on commit 3361581

Please sign in to comment.