Skip to content

Commit

Permalink
Fix governance:build-proposal bigNumber bug (#8028)
Browse files Browse the repository at this point in the history
Looks like this was related to ethers-io/ethers.js#228, but we just need to force the bignumber string to not be in scientific notation when transforming the value, and then this works as expected. Note that the outputted value in the outputted transaction will **not** be in scientific notation.

Closes #7466
  • Loading branch information
eelanagaraj authored Jun 2, 2021
1 parent 3cdeb8e commit dc3e192
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/sdk/governance/src/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,9 @@ export class InteractiveProposalBuilder {

// @ts-ignore
const answer: string = inputAnswer[functionInput.name]
// transformedValue may not be in scientific notation
const transformedValue =
functionInput.type === 'uint256' ? new BigNumber(answer).toString() : answer
functionInput.type === 'uint256' ? new BigNumber(answer).toString(10) : answer
args.push(transformedValue)
}

Expand Down

0 comments on commit dc3e192

Please sign in to comment.