Address INVALID_ARGUMENT issue

This commit is contained in:
Bryce
2018-06-22 13:35:49 -07:00
parent 80fe1938b8
commit 82d59dbea8
5 changed files with 8688 additions and 3 deletions

8674
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"private": true,
"name": "0x-monorepo",
"engines": {
"node" : ">=6.12"
"node": ">=6.12"
},
"workspaces": [
"packages/*"

View File

@@ -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",

View File

@@ -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

View File

@@ -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',
}
}