diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-10-03 17:31:46 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-10-04 16:14:19 +0800 |
commit | 6bbdc98ba29633828f0533c8bb40a200cf142436 (patch) | |
tree | 3345e7ba89bcca9f8cd470904d555bc5fcd000a1 /src/0x.ts | |
parent | a9681072ee4b45bda23b754fa46175b68c09b8b9 (diff) | |
download | dexon-sol-tools-6bbdc98ba29633828f0533c8bb40a200cf142436.tar dexon-sol-tools-6bbdc98ba29633828f0533c8bb40a200cf142436.tar.gz dexon-sol-tools-6bbdc98ba29633828f0533c8bb40a200cf142436.tar.bz2 dexon-sol-tools-6bbdc98ba29633828f0533c8bb40a200cf142436.tar.lz dexon-sol-tools-6bbdc98ba29633828f0533c8bb40a200cf142436.tar.xz dexon-sol-tools-6bbdc98ba29633828f0533c8bb40a200cf142436.tar.zst dexon-sol-tools-6bbdc98ba29633828f0533c8bb40a200cf142436.zip |
Move log decoding to AbiDecoder
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 23 |
1 files changed, 2 insertions, 21 deletions
@@ -302,7 +302,8 @@ export class ZeroEx { const transactionReceipt = await this._web3Wrapper.getTransactionReceiptAsync(txHash); if (!_.isNull(transactionReceipt)) { intervalUtils.clearAsyncExcludingInterval(intervalId); - const logsWithDecodedArgs = _.map(transactionReceipt.logs, this.tryToDecodeLogOrNoOp.bind(this)); + const tryToDecodeLogOrNoOp = this._abiDecoder.tryToDecodeLogOrNoOp.bind(this._abiDecoder); + const logsWithDecodedArgs = _.map(transactionReceipt.logs, tryToDecodeLogOrNoOp); const transactionReceiptWithDecodedLogArgs: TransactionReceiptWithDecodedLogs = { ...transactionReceipt, logs: logsWithDecodedArgs, @@ -313,26 +314,6 @@ export class ZeroEx { }); return txReceiptPromise; } - /** - * Gets historical logs without creating a subscription - * @param filter Filter object - * @return Array of logs that match the filter - */ - public async getLogsAsync(filter: FilterObject): Promise<RawLog[]> { - const logs = await this._web3Wrapper.getLogsAsync(filter); - return logs; - } - private tryToDecodeLogOrNoOp(log: Web3.LogEntry): LogWithDecodedArgs|Web3.LogEntry { - const decodedLog = this._abiDecoder.decodeLog(log); - if (_.isUndefined(decodedLog)) { - return log; - } - const logWithDecodedArgs: LogWithDecodedArgs = { - ...log, - ...decodedLog, - }; - return logWithDecodedArgs; - } /* * HACK: `TokenWrapper` needs a token transfer proxy address. `TokenTransferProxy` address is fetched from * an `ExchangeWrapper`. `ExchangeWrapper` needs `TokenWrapper` to validate orders, creating a dependency cycle. |