Skip to content

Commit

Permalink
Merge pull request #101 from makerdao/CDP-415-allowances-issue
Browse files Browse the repository at this point in the history
CDP-415 convert allowance and BN max uint to number before comparing
  • Loading branch information
b-pmcg authored Sep 5, 2019
2 parents 48cc86f + fd0c22c commit 4a96e67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/reducers/multicall/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export function accountBalanceForToken(
returns: [
[
`accounts.${currentAddress}.allowances.${tokenSymbol}`,
allowance => fromWei(allowance).eq(MAX_UINT_BN)
// Unlimited allowance may be a tiny bit less than MAX_UINT_BN,
// calling .toNumber() gives us a reasonably large number to compare.
allowance =>
fromWei(allowance).toNumber() === MAX_UINT_BN.toNumber()
]
]
}
Expand Down

1 comment on commit 4a96e67

@vercel
Copy link

@vercel vercel bot commented on 4a96e67 Sep 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.