aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package.json3
-rw-r--r--src/globals.d.ts8
-rw-r--r--test/artifacts_test.ts28
-rw-r--r--test/utils/constants.ts1
-rw-r--r--yarn.lock40
5 files changed, 75 insertions, 5 deletions
diff --git a/package.json b/package.json
index 7949f5355..c69700bc1 100644
--- a/package.json
+++ b/package.json
@@ -79,12 +79,13 @@
"shx": "^0.2.2",
"sinon": "^2.3.2",
"source-map-support": "^0.4.15",
+ "truffle-hdwallet-provider": "^0.0.3",
"tslint": "^5.3.2",
"tslint-config-0xproject": "^0.0.2",
"typedoc": "^0.7.1",
"typescript": "^2.3.3",
"web3-provider-engine": "^13.0.1",
- "web3-typescript-typings": "^0.0.9",
+ "web3-typescript-typings": "^0.0.10",
"webpack": "^2.6.0"
},
"dependencies": {
diff --git a/src/globals.d.ts b/src/globals.d.ts
index 15ebe03d0..4a0a3fb04 100644
--- a/src/globals.d.ts
+++ b/src/globals.d.ts
@@ -86,3 +86,11 @@ declare module 'es6-promisify' {
declare module 'ethereumjs-abi' {
const soliditySHA3: (argTypes: string[], args: any[]) => Buffer;
}
+
+// truffle-hdwallet-provider declarations
+declare class HDWalletProvider {
+ constructor(mnemonic: string, rpcUrl: string);
+}
+declare module 'truffle-hdwallet-provider' {
+ export = HDWalletProvider;
+}
diff --git a/test/artifacts_test.ts b/test/artifacts_test.ts
new file mode 100644
index 000000000..d71b45567
--- /dev/null
+++ b/test/artifacts_test.ts
@@ -0,0 +1,28 @@
+import * as fs from 'fs';
+import HDWalletProvider = require('truffle-hdwallet-provider');
+import {ZeroEx} from '../src';
+import {web3Factory} from './utils/web3_factory';
+import {constants} from './utils/constants';
+
+// Those tests are slower cause they're talking to a remote node
+const TIMEOUT = 10000;
+
+describe('Artifacts', () => {
+ describe('contracts are deployed on kovan', () => {
+ const kovanRpcUrl = constants.KOVAN_RPC_URL;
+ const packageJSONContent = fs.readFileSync('package.json', 'utf-8');
+ const packageJSON = JSON.parse(packageJSONContent);
+ const mnemonic = packageJSON.config.mnemonic;
+ const web3Provider = new HDWalletProvider(mnemonic, kovanRpcUrl);
+ const zeroEx = new ZeroEx(web3Provider);
+ it('token registry contract is deployed', async () => {
+ await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync();
+ }).timeout(TIMEOUT);
+ it('proxy contract is deployed', async () => {
+ await (zeroEx.token as any)._getProxyAddressAsync();
+ }).timeout(TIMEOUT);
+ it('exchange contract is deployed', async () => {
+ await (zeroEx.exchange as any)._getExchangeContractAsync();
+ }).timeout(TIMEOUT);
+ });
+});
diff --git a/test/utils/constants.ts b/test/utils/constants.ts
index aa1967f88..9b150b5c1 100644
--- a/test/utils/constants.ts
+++ b/test/utils/constants.ts
@@ -2,4 +2,5 @@ export const constants = {
NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
RPC_HOST: 'localhost',
RPC_PORT: 8545,
+ KOVAN_RPC_URL: 'https://kovan.0xproject.com',
};
diff --git a/yarn.lock b/yarn.lock
index 674bb9246..94d3ad2db 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -42,10 +42,14 @@
version "2.2.41"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.41.tgz#e27cf0817153eb9f2713b2d3f6c68f1e1c3ca608"
-"@types/node@*", "@types/node@^7.0.22":
+"@types/node@*":
version "7.0.23"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.23.tgz#ededfd92e61046c32fcad56ea7e1101733fad4a4"
+"@types/node@^8.0.1":
+ version "8.0.1"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.1.tgz#89c271e0c3b9ebb6a3756dd601336970b6228b77"
+
"@types/shelljs@^0.7.0":
version "0.7.1"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.1.tgz#30fe144e3bdd37c11c174445bc54190cb7992a45"
@@ -716,7 +720,7 @@ bindings@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11"
-bip39@~2.2.0:
+bip39@^2.2.0, bip39@~2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.2.0.tgz#40e73f70674c267f148cdbf8374f2a50be166b0d"
dependencies:
@@ -1548,7 +1552,7 @@ ethereumjs-vm@^2.0.2, ethereumjs-vm@~2.0.1:
functional-red-black-tree "^1.0.1"
merkle-patricia-tree "^2.1.2"
-ethereumjs-wallet@~0.6.0:
+ethereumjs-wallet@^0.6.0, ethereumjs-wallet@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.0.tgz#82763b1697ee7a796be7155da9dfb49b2f98cfdb"
dependencies:
@@ -4247,6 +4251,15 @@ truffle-contract@^2.0.1:
truffle-contract-schema "0.0.5"
web3 "^0.18.0"
+truffle-hdwallet-provider@^0.0.3:
+ version "0.0.3"
+ resolved "https://registry.yarnpkg.com/truffle-hdwallet-provider/-/truffle-hdwallet-provider-0.0.3.tgz#0e1de02104b73d3875e1cf7093305b4ea8a2d843"
+ dependencies:
+ bip39 "^2.2.0"
+ ethereumjs-wallet "^0.6.0"
+ web3 "^0.18.2"
+ web3-provider-engine "^8.4.0"
+
tslib@^1.7.1:
version "1.7.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.7.1.tgz#bc8004164691923a79fe8378bbeb3da2017538ec"
@@ -4448,6 +4461,25 @@ web3-provider-engine@^13.0.1:
xhr "^2.2.0"
xtend "^4.0.1"
+web3-provider-engine@^8.4.0:
+ version "8.6.1"
+ resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-8.6.1.tgz#4d86e19e30caaf97df351511ec0f60136e5b30eb"
+ dependencies:
+ async "^2.1.2"
+ clone "^2.0.0"
+ ethereumjs-block "^1.2.2"
+ ethereumjs-tx "^1.2.0"
+ ethereumjs-util "^5.0.1"
+ ethereumjs-vm "^2.0.2"
+ isomorphic-fetch "^2.2.0"
+ request "^2.67.0"
+ semaphore "^1.0.3"
+ solc "^0.4.2"
+ tape "^4.4.0"
+ web3 "^0.16.0"
+ xhr "^2.2.0"
+ xtend "^4.0.1"
+
web3-provider-engine@~8.1.0:
version "8.1.19"
resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-8.1.19.tgz#3ccae95adecef55632e2a73bf3bee64b7e62fcf7"
@@ -4482,7 +4514,7 @@ web3@^0.16.0, web3@~0.16.0:
utf8 "^2.1.1"
xmlhttprequest "*"
-web3@^0.18.0:
+web3@^0.18.0, web3@^0.18.2:
version "0.18.4"
resolved "https://registry.yarnpkg.com/web3/-/web3-0.18.4.tgz#81ec1784145491f2eaa8955b31c06049e07c5e7d"
dependencies: