diff options
author | Bryce <brycedneal@gmail.com> | 2018-06-23 04:35:49 +0800 |
---|---|---|
committer | Bryce <brycedneal@gmail.com> | 2018-06-23 04:35:49 +0800 |
commit | 82d59dbea80c351a5ac8de34debd182775eb870e (patch) | |
tree | b8e7edb2ba103925b166a4a9f39fc3334f88fdd8 /packages | |
parent | 80fe1938b8cc7ad2b72972133cf9594fa4ee04d9 (diff) | |
download | dexon-0x-contracts-82d59dbea80c351a5ac8de34debd182775eb870e.tar.gz dexon-0x-contracts-82d59dbea80c351a5ac8de34debd182775eb870e.tar.zst dexon-0x-contracts-82d59dbea80c351a5ac8de34debd182775eb870e.zip |
Address INVALID_ARGUMENT issue
Diffstat (limited to 'packages')
-rw-r--r-- | packages/order-watcher/package.json | 2 | ||||
-rw-r--r-- | packages/order-watcher/src/order_watcher/order_watcher.ts | 10 | ||||
-rw-r--r-- | packages/typescript-typings/types/ethers/index.d.ts | 3 |
3 files changed, 13 insertions, 2 deletions
diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 6cee9da16..efc44a89f 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/order-watcher", - "version": "0.0.6", + "version": "0.0.7", "description": "An order watcher daemon that watches for order validity", "keywords": [ "0x", diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 140aa341b..5834cf9b6 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -16,6 +16,7 @@ import { } from '@0xproject/types'; import { errorUtils, intervalUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import * as ethers from 'ethers'; import * as _ from 'lodash'; import { artifacts } from '../artifacts'; @@ -241,7 +242,14 @@ export class OrderWatcher { return; } const log = logIfExists as LogEntryEvent; // At this moment we are sure that no error occured and log is defined. - const maybeDecodedLog = this._web3Wrapper.abiDecoder.tryToDecodeLogOrNoop<ContractEventArgs>(log); + let maybeDecodedLog; + try { + maybeDecodedLog = this._web3Wrapper.abiDecoder.tryToDecodeLogOrNoop<ContractEventArgs>(log); + } catch (error) { + if (error.code === ethers.errors.INVALID_ARGUMENT) { + return; // noop + } + } const isLogDecoded = !_.isUndefined(((maybeDecodedLog as any) as LogWithDecodedArgs<ContractEventArgs>).event); if (!isLogDecoded) { return; // noop diff --git a/packages/typescript-typings/types/ethers/index.d.ts b/packages/typescript-typings/types/ethers/index.d.ts index d40428a9b..c3ec82163 100644 --- a/packages/typescript-typings/types/ethers/index.d.ts +++ b/packages/typescript-typings/types/ethers/index.d.ts @@ -31,4 +31,7 @@ declare module 'ethers' { public static getDeployTransaction(bytecode: string, abi: any, ...args: any[]): Partial<TxData>; constructor(address: string, abi: any, provider: any); } + const enum errors { + INVALID_ARGUMENT = 'INVALID_ARGUMENT', + } } |