From b38aff8808db0ade04746f69bbb25b62147d17a4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 6 Sep 2017 17:26:55 +0200 Subject: Fix log decoder to return correct types --- src/utils/abi_decoder.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/utils/abi_decoder.ts') diff --git a/src/utils/abi_decoder.ts b/src/utils/abi_decoder.ts index f988a5695..61c8eecd4 100644 --- a/src/utils/abi_decoder.ts +++ b/src/utils/abi_decoder.ts @@ -1,5 +1,6 @@ import * as Web3 from 'web3'; import * as _ from 'lodash'; +import * as BigNumber from 'bignumber.js'; import {AbiType, DecodedLogArgs, DecodedArgs} from '../types'; import * as SolidityCoder from 'web3/lib/solidity/coder'; @@ -31,9 +32,9 @@ export class AbiDecoder { dataIndex++; } if (param.type === 'address') { - value = this.padZeros(new Web3().toBigNumber(value).toString(16)); + value = this.padZeros(new BigNumber(value).toString(16)); } else if (param.type === 'uint256' || param.type === 'uint8' || param.type === 'int' ) { - value = new Web3().toBigNumber(value).toString(10); + value = new BigNumber(value); } decodedParams[param.name] = value; }); -- cgit v1.2.3