aboutsummaryrefslogtreecommitdiffstats
path: root/packages/assert
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-13 01:38:13 +0800
committerFabio Berger <me@fabioberger.com>2017-12-13 01:38:13 +0800
commit4f72c527def4adef60200b60f9bf6221956af7a3 (patch)
treecfe74030bf9ebbfee9063da6faa878f995b65715 /packages/assert
parent71cb2e05d1d3d7e2abbbe319dc7a39d7d79d01ac (diff)
parentcb7188d47390719b74d7e09c938068a9f201c1b0 (diff)
downloaddexon-sol-tools-4f72c527def4adef60200b60f9bf6221956af7a3.tar
dexon-sol-tools-4f72c527def4adef60200b60f9bf6221956af7a3.tar.gz
dexon-sol-tools-4f72c527def4adef60200b60f9bf6221956af7a3.tar.bz2
dexon-sol-tools-4f72c527def4adef60200b60f9bf6221956af7a3.tar.lz
dexon-sol-tools-4f72c527def4adef60200b60f9bf6221956af7a3.tar.xz
dexon-sol-tools-4f72c527def4adef60200b60f9bf6221956af7a3.tar.zst
dexon-sol-tools-4f72c527def4adef60200b60f9bf6221956af7a3.zip
Merge branch 'development' of github.com:0xProject/0x.js into development
* 'development' of github.com:0xProject/0x.js: Re-hard code the dependency Add missing dependency Add missing dependency Fix a dependency Fix an invocation Move dependency Merge dependencies Don't unsubscribe on error. It's done automatically Rename blockAndLogStreamer to blockAndLogStreamerIfExists Move isAddress to shared utils and remove all dependencies on ethereum-address Remove ethereum-address dependency and add this logic to the repo
Diffstat (limited to 'packages/assert')
-rw-r--r--packages/assert/package.json2
-rw-r--r--packages/assert/src/globals.d.ts4
-rw-r--r--packages/assert/src/index.ts6
3 files changed, 4 insertions, 8 deletions
diff --git a/packages/assert/package.json b/packages/assert/package.json
index 65b163c21..2fb7746a8 100644
--- a/packages/assert/package.json
+++ b/packages/assert/package.json
@@ -38,8 +38,8 @@
},
"dependencies": {
"@0xproject/json-schemas": "^0.6.10",
+ "@0xproject/utils": "^0.1.0",
"bignumber.js": "~4.1.0",
- "ethereum-address": "^0.0.4",
"lodash": "^4.17.4",
"valid-url": "^1.0.9"
}
diff --git a/packages/assert/src/globals.d.ts b/packages/assert/src/globals.d.ts
index cc47f3113..91ed2021e 100644
--- a/packages/assert/src/globals.d.ts
+++ b/packages/assert/src/globals.d.ts
@@ -1,5 +1 @@
declare module 'dirty-chai';
-
-declare module 'ethereum-address' {
- const isAddress: (arg: any) => boolean;
-}
diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts
index 92bcf6f03..fadc31d09 100644
--- a/packages/assert/src/index.ts
+++ b/packages/assert/src/index.ts
@@ -2,8 +2,8 @@ import {
Schema,
SchemaValidator,
} from '@0xproject/json-schemas';
+import {addressUtils} from '@0xproject/utils';
import BigNumber from 'bignumber.js';
-import * as ethereum_address from 'ethereum-address';
import * as _ from 'lodash';
import * as validUrl from 'valid-url';
@@ -35,9 +35,9 @@ export const assert = {
this.typeAssertionMessage(variableName, 'HexString', value));
},
isETHAddressHex(variableName: string, value: string): void {
- this.assert(ethereum_address.isAddress(value), this.typeAssertionMessage(variableName, 'ETHAddressHex', value));
+ this.assert(addressUtils.isAddress(value), this.typeAssertionMessage(variableName, 'ETHAddressHex', value));
this.assert(
- ethereum_address.isAddress(value) && value.toLowerCase() === value,
+ addressUtils.isAddress(value) && value.toLowerCase() === value,
`Checksummed addresses are not supported. Convert ${variableName} to lower case before passing`,
);
},