diff options
author | Fabio Berger <me@fabioberger.com> | 2018-12-07 23:21:55 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-13 01:19:26 +0800 |
commit | e3681069329d0c10d58b6672940b99f427f72bba (patch) | |
tree | 92262f0b69fead537048ec368fdfbb148855042e /packages/web3-wrapper/src | |
parent | 785981ce58c59cb9d8a553ce64657403f5217bad (diff) | |
download | dexon-0x-contracts-e3681069329d0c10d58b6672940b99f427f72bba.tar.gz dexon-0x-contracts-e3681069329d0c10d58b6672940b99f427f72bba.tar.zst dexon-0x-contracts-e3681069329d0c10d58b6672940b99f427f72bba.zip |
fix: txData returned so that `value` and `gasPrice` are BigNumbers to avoid precision errors
Diffstat (limited to 'packages/web3-wrapper/src')
-rw-r--r-- | packages/web3-wrapper/src/marshaller.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/web3-wrapper/src/marshaller.ts b/packages/web3-wrapper/src/marshaller.ts index 7bd274c85..b368695bd 100644 --- a/packages/web3-wrapper/src/marshaller.ts +++ b/packages/web3-wrapper/src/marshaller.ts @@ -1,4 +1,4 @@ -import { addressUtils } from '@0x/utils'; +import { addressUtils, BigNumber } from '@0x/utils'; import { BlockParam, BlockParamLiteral, @@ -120,10 +120,10 @@ 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, - nonce: !_.isUndefined(txDataRpc.nonce) ? utils.convertHexToNumber(txDataRpc.nonce) : undefined, + gasPrice: !_.isUndefined(txDataRpc.gasPrice) ? utils.convertAmountToBigNumber(txDataRpc.gasPrice) : undefined, + nonce: !_.isUndefined(txDataRpc.nonce) ? utils.convertHexToNumber(txDataRpc.nonce) : undefined, , , , , , , , }; return txData; }, |