From a14424ae5f45784db5e75c2d6a9098dc96914c9e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 11 Dec 2017 12:43:19 +0100 Subject: Move isAddress to shared utils and remove all dependencies on ethereum-address --- packages/website/package.json | 1 - packages/website/ts/components/inputs/address_input.tsx | 2 +- packages/website/ts/globals.d.ts | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) (limited to 'packages/website') diff --git a/packages/website/package.json b/packages/website/package.json index 95e060552..9b261c76c 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -28,7 +28,6 @@ "dateformat": "^2.0.0", "deep-equal": "^1.0.1", "dharma-loan-frame": "^0.0.12", - "ethereum-address": "^0.0.4", "ethereumjs-tx": "^1.3.3", "ethereumjs-util": "^5.1.1", "find-versions": "^2.0.0", diff --git a/packages/website/ts/components/inputs/address_input.tsx b/packages/website/ts/components/inputs/address_input.tsx index 8b03b8d12..832324fda 100644 --- a/packages/website/ts/components/inputs/address_input.tsx +++ b/packages/website/ts/components/inputs/address_input.tsx @@ -1,4 +1,4 @@ -import {isAddress} from 'ethereum-address'; +import {addressUtils} from '@0xproject/utils'; import * as _ from 'lodash'; import {colors} from 'material-ui/styles'; import TextField from 'material-ui/TextField'; diff --git a/packages/website/ts/globals.d.ts b/packages/website/ts/globals.d.ts index b4611f583..3144d7eb5 100644 --- a/packages/website/ts/globals.d.ts +++ b/packages/website/ts/globals.d.ts @@ -55,11 +55,6 @@ interface System { } declare var System: System; -// ethereum-address declarations -declare module 'ethereum-address' { - export const isAddress: (address: string) => boolean; -} - // jsonschema declarations // Source: https://github.com/tdegrunt/jsonschema/blob/master/lib/index.d.ts declare interface Schema { -- cgit v1.2.3 From c61fe3ce64e58e7ae427642430621b857c3a716d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 12 Dec 2017 13:33:12 +0100 Subject: Don't unsubscribe on error. It's done automatically --- packages/website/package.json | 2 +- packages/website/ts/blockchain.ts | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'packages/website') diff --git a/packages/website/package.json b/packages/website/package.json index 95e060552..13ee2b082 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -18,7 +18,7 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "0xproject/0x.js/packages/0x.js#0x.js@0.27.1", + "0x.js": "^0.27.2", "@0xproject/subproviders": "^0.1.0", "accounting": "^0.4.1", "basscss": "^8.0.3", diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 76640a072..172ba6b52 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -468,8 +468,7 @@ export class Blockchain { public destroy() { clearInterval(this.zrxPollIntervalId); this.web3Wrapper.destroy(); - // tslint:disable-next-line:no-floating-promises - this.stopWatchingExchangeLogFillEventsAsync(); // fire and forget + this.stopWatchingExchangeLogFillEvents(); } private async showEtherScanLinkAndAwaitTransactionMinedAsync( txHash: string): Promise { @@ -485,7 +484,7 @@ export class Blockchain { } private async rehydrateStoreWithContractEvents() { // Ensure we are only ever listening to one set of events - await this.stopWatchingExchangeLogFillEventsAsync(); + this.stopWatchingExchangeLogFillEvents(); if (!this.doesUserAddressExist()) { return; // short-circuit @@ -517,8 +516,6 @@ export class Blockchain { // to rollbar and stop watching when one occurs // tslint:disable-next-line:no-floating-promises errorReporter.reportAsync(err); // fire and forget - // tslint:disable-next-line:no-floating-promises - this.stopWatchingExchangeLogFillEventsAsync(); // fire and forget return; } else { const decodedLog = decodedLogEvent.log; @@ -593,7 +590,7 @@ export class Blockchain { tradeHistoryStorage.setFillsLatestBlock(this.userAddress, this.networkId, blockNumberToSet); } } - private async stopWatchingExchangeLogFillEventsAsync() { + private stopWatchingExchangeLogFillEvents(): void { this.zeroEx.exchange.unsubscribeAll(); } private async getTokenRegistryTokensByAddressAsync(): Promise { -- cgit v1.2.3 From 16a970b65d72a07ef4ebd9d0ec062f9323525f2e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 12 Dec 2017 13:56:19 +0100 Subject: Fix an invocation --- packages/website/ts/components/inputs/address_input.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/ts/components/inputs/address_input.tsx b/packages/website/ts/components/inputs/address_input.tsx index 832324fda..40ae722d9 100644 --- a/packages/website/ts/components/inputs/address_input.tsx +++ b/packages/website/ts/components/inputs/address_input.tsx @@ -62,7 +62,7 @@ export class AddressInput extends React.Component Date: Tue, 12 Dec 2017 15:23:00 +0100 Subject: Re-hard code the dependency --- packages/website/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/package.json b/packages/website/package.json index 13ee2b082..5162a27ff 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -18,7 +18,7 @@ "author": "Fabio Berger", "license": "Apache-2.0", "dependencies": { - "0x.js": "^0.27.2", + "0x.js": "0.27.1", "@0xproject/subproviders": "^0.1.0", "accounting": "^0.4.1", "basscss": "^8.0.3", -- cgit v1.2.3