diff options
author | Fabio B <kandinsky454@protonmail.ch> | 2018-12-09 05:57:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-09 05:57:06 +0800 |
commit | a286228b2005c33cc4ca8e17772a9bd259eeb1ce (patch) | |
tree | 582f3fef57a3a3be0c7e8d44ffd5bdde958c541d /packages/web3-wrapper/src/marshaller.ts | |
parent | aa4fcebdc71fa58b12dc12ab03d7697444416c09 (diff) | |
parent | 1a44d86c59fea7b08a8f30b078d8e2c9b730b1b3 (diff) | |
download | dexon-sol-tools-a286228b2005c33cc4ca8e17772a9bd259eeb1ce.tar dexon-sol-tools-a286228b2005c33cc4ca8e17772a9bd259eeb1ce.tar.gz dexon-sol-tools-a286228b2005c33cc4ca8e17772a9bd259eeb1ce.tar.bz2 dexon-sol-tools-a286228b2005c33cc4ca8e17772a9bd259eeb1ce.tar.lz dexon-sol-tools-a286228b2005c33cc4ca8e17772a9bd259eeb1ce.tar.xz dexon-sol-tools-a286228b2005c33cc4ca8e17772a9bd259eeb1ce.tar.zst dexon-sol-tools-a286228b2005c33cc4ca8e17772a9bd259eeb1ce.zip |
Merge pull request #1402 from 0xProject/web3-wrapper/numberBigNumberMixup
Fix `value` and `gasPrice` precision bug by returning them as BigNumbers
Diffstat (limited to 'packages/web3-wrapper/src/marshaller.ts')
-rw-r--r-- | packages/web3-wrapper/src/marshaller.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/web3-wrapper/src/marshaller.ts b/packages/web3-wrapper/src/marshaller.ts index 7bd274c85..4230f8eab 100644 --- a/packages/web3-wrapper/src/marshaller.ts +++ b/packages/web3-wrapper/src/marshaller.ts @@ -120,9 +120,11 @@ export const marshaller = { } const txData = { ...txDataRpc, - value: !_.isUndefined(txDataRpc.value) ? utils.convertHexToNumber(txDataRpc.value) : undefined, + value: !_.isUndefined(txDataRpc.value) ? utils.convertAmountToBigNumber(txDataRpc.value) : undefined, gas: !_.isUndefined(txDataRpc.gas) ? utils.convertHexToNumber(txDataRpc.gas) : undefined, - gasPrice: !_.isUndefined(txDataRpc.gasPrice) ? utils.convertHexToNumber(txDataRpc.gasPrice) : undefined, + gasPrice: !_.isUndefined(txDataRpc.gasPrice) + ? utils.convertAmountToBigNumber(txDataRpc.gasPrice) + : undefined, nonce: !_.isUndefined(txDataRpc.nonce) ? utils.convertHexToNumber(txDataRpc.nonce) : undefined, }; return txData; |