From 3eb232b3fcd73eec25efa6754530bc54b88f3f82 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 13 Jun 2018 13:18:19 +0200 Subject: For some reason order-watcher tests were timeing out so I increased the timeout limit --- packages/order-watcher/test/global_hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/test/global_hooks.ts b/packages/order-watcher/test/global_hooks.ts index f18eef379..2018c7545 100644 --- a/packages/order-watcher/test/global_hooks.ts +++ b/packages/order-watcher/test/global_hooks.ts @@ -7,7 +7,7 @@ import { provider } from './utils/web3_wrapper'; before('migrate contracts', async function(): Promise { // HACK: Since the migrations take longer then our global mocha timeout limit // we manually increase it for this before hook. - const mochaTestTimeoutMs = 20000; + const mochaTestTimeoutMs = 25000; this.timeout(mochaTestTimeoutMs); const txDefaults = { gas: devConstants.GAS_LIMIT, -- cgit From 82d59dbea80c351a5ac8de34debd182775eb870e Mon Sep 17 00:00:00 2001 From: Bryce Date: Fri, 22 Jun 2018 13:35:49 -0700 Subject: Address INVALID_ARGUMENT issue --- packages/order-watcher/package.json | 2 +- packages/order-watcher/src/order_watcher/order_watcher.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'packages/order-watcher') 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(log); + let maybeDecodedLog; + try { + maybeDecodedLog = this._web3Wrapper.abiDecoder.tryToDecodeLogOrNoop(log); + } catch (error) { + if (error.code === ethers.errors.INVALID_ARGUMENT) { + return; // noop + } + } const isLogDecoded = !_.isUndefined(((maybeDecodedLog as any) as LogWithDecodedArgs).event); if (!isLogDecoded) { return; // noop -- cgit From d315133d3458534c40bb35c4df4edf48b8c21d96 Mon Sep 17 00:00:00 2001 From: Bryce Date: Fri, 22 Jun 2018 14:01:14 -0700 Subject: Re-throw if not INVALID_ARGUMENT --- packages/order-watcher/src/order_watcher/order_watcher.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 5834cf9b6..bf31c9c4d 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -249,6 +249,7 @@ export class OrderWatcher { if (error.code === ethers.errors.INVALID_ARGUMENT) { return; // noop } + throw error; } const isLogDecoded = !_.isUndefined(((maybeDecodedLog as any) as LogWithDecodedArgs).event); if (!isLogDecoded) { -- cgit From b8aa68b4d14206be9c667a203328bf4cd97ef0e4 Mon Sep 17 00:00:00 2001 From: Bryce Date: Fri, 22 Jun 2018 14:05:23 -0700 Subject: Add CHANGELOG entry --- packages/order-watcher/CHANGELOG.json | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 4afd4b9b5..77b1168cc 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,4 +1,14 @@ [ + { + "timestamp": 1529701469, + "version": "0.0.7", + "changes": [ + { + "note": "Fixes Uncaught Error in OrderWatcher", + "pr": 763 + } + ] + }, { "timestamp": 1529397769, "version": "0.0.6", -- cgit From 1ef4a4725501b608b2c2c973af0181bfb9a1d0e0 Mon Sep 17 00:00:00 2001 From: Bryce Date: Fri, 22 Jun 2018 14:06:45 -0700 Subject: Fix spacing --- packages/order-watcher/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 77b1168cc..4f2a52532 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -5,7 +5,7 @@ "changes": [ { "note": "Fixes Uncaught Error in OrderWatcher", - "pr": 763 + "pr": 763 } ] }, -- cgit From a207260fe0c13144cbaceb39386e0cbbd92179f8 Mon Sep 17 00:00:00 2001 From: Bryce Neal Date: Fri, 22 Jun 2018 14:07:19 -0700 Subject: Fix CHANGELOG spacing. --- packages/order-watcher/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 4f2a52532..77b1168cc 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -5,7 +5,7 @@ "changes": [ { "note": "Fixes Uncaught Error in OrderWatcher", - "pr": 763 + "pr": 763 } ] }, -- cgit From 9f8cad93f794b9a95b3a947c5c61eefcb603f2e9 Mon Sep 17 00:00:00 2001 From: Bryce Neal Date: Fri, 22 Jun 2018 14:08:21 -0700 Subject: CHANGELOG spacing --- packages/order-watcher/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 77b1168cc..28b210b8e 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -5,7 +5,7 @@ "changes": [ { "note": "Fixes Uncaught Error in OrderWatcher", - "pr": 763 + "pr": 763 } ] }, -- cgit From f7fe9b096115312f25f90a27a8f9e13e374dcc2b Mon Sep 17 00:00:00 2001 From: Bryce Date: Fri, 22 Jun 2018 16:39:58 -0700 Subject: Update at abi_decoder --- packages/order-watcher/CHANGELOG.json | 4 +--- packages/order-watcher/package.json | 2 +- packages/order-watcher/src/order_watcher/order_watcher.ts | 11 +---------- 3 files changed, 3 insertions(+), 14 deletions(-) (limited to 'packages/order-watcher') diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 28b210b8e..00f6ad1b9 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,11 +1,9 @@ [ { - "timestamp": 1529701469, "version": "0.0.7", "changes": [ { - "note": "Fixes Uncaught Error in OrderWatcher", - "pr": 763 + "note": "Dependencies updated" } ] }, diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index efc44a89f..3335713a3 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -85,7 +85,7 @@ "@0xproject/order-utils": "^0.0.7", "@0xproject/types": "^0.8.1", "@0xproject/typescript-typings": "^0.4.1", - "@0xproject/utils": "^0.7.1", + "@0xproject/utils": "^0.7.3", "@0xproject/web3-wrapper": "^0.7.1", "ethereum-types": "^0.0.1", "bintrees": "^1.0.2", diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index bf31c9c4d..140aa341b 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -16,7 +16,6 @@ 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'; @@ -242,15 +241,7 @@ export class OrderWatcher { return; } const log = logIfExists as LogEntryEvent; // At this moment we are sure that no error occured and log is defined. - let maybeDecodedLog; - try { - maybeDecodedLog = this._web3Wrapper.abiDecoder.tryToDecodeLogOrNoop(log); - } catch (error) { - if (error.code === ethers.errors.INVALID_ARGUMENT) { - return; // noop - } - throw error; - } + const maybeDecodedLog = this._web3Wrapper.abiDecoder.tryToDecodeLogOrNoop(log); const isLogDecoded = !_.isUndefined(((maybeDecodedLog as any) as LogWithDecodedArgs).event); if (!isLogDecoded) { return; // noop -- cgit