-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bignumber support #144
Conversation
src/crypto/wallet.js
Outdated
const fee = util.signTransaction(fakeWallet, inputs, outputs, changeAddress) | ||
.fee | ||
const fee = new BigNumber( | ||
util.signTransaction(fakeWallet, inputs, outputs, changeAddress).fee, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I wonder whether util.signTransaction shouldn't do this conversion...
} | ||
|
||
// Note(ppershing): upgrade to bignum once we use it | ||
const _sum = (a: Array<{amount: number}>) => | ||
a.reduce((acc, x) => acc + x.amount, 0) | ||
const _sum = (a: Array<{amount: BigNumber}>): BigNumber => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
src/utils/transactions.js
Outdated
const _sum = (a: Array<{amount: number}>) => | ||
a.reduce((acc, x) => acc + x.amount, 0) | ||
const _sum = (a: Array<{amount: BigNumber}>): BigNumber => | ||
a.reduce((acc: BigNumber, x) => acc.plus(x.amount), new BigNumber(0, 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why new Bignumber(0, 10)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve let's hope you fixed this in all locations!
No description provided.