diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2017-12-07 16:45:41 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2017-12-13 07:05:27 +0800 |
commit | 2cc410e61f75a43ce36416b7d15f897d6e7fc92c (patch) | |
tree | db2a73fe71f1f59d4f99c7ad041b705566435cdc | |
parent | 548fda8dbaadc4827137d4b90753b306fdfd554b (diff) | |
download | dexon-0x-contracts-2cc410e61f75a43ce36416b7d15f897d6e7fc92c.tar.gz dexon-0x-contracts-2cc410e61f75a43ce36416b7d15f897d6e7fc92c.tar.zst dexon-0x-contracts-2cc410e61f75a43ce36416b7d15f897d6e7fc92c.zip |
Update 0x.js version, fix build errors
-rw-r--r-- | packages/contracts/package.json | 2 | ||||
-rw-r--r-- | packages/contracts/test/ts/erc20Token.ts | 5 | ||||
-rw-r--r-- | packages/contracts/test/ts/ether_token.ts | 7 | ||||
-rw-r--r-- | packages/contracts/test/ts/ether_token_v2.ts | 10 | ||||
-rw-r--r-- | packages/contracts/test/ts/exchange/core.ts | 1 | ||||
-rw-r--r-- | packages/contracts/test/ts/unlimitedAllowanceToken.ts | 6 | ||||
-rw-r--r-- | packages/contracts/test/ts/zrxToken.ts | 6 | ||||
-rw-r--r-- | packages/contracts/util/constants.ts | 1 | ||||
-rw-r--r-- | yarn.lock | 63 |
9 files changed, 41 insertions, 60 deletions
diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 3c5dfe890..31c69e8d5 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -53,7 +53,7 @@ "yargs": "^10.0.3" }, "dependencies": { - "0x.js": "^0.22.6", + "0x.js": "^0.27.1", "@0xproject/json-schemas": "^0.6.10", "@0xproject/utils": "^0.1.0", "@0xproject/web3-wrapper": "^0.1.0", diff --git a/packages/contracts/test/ts/erc20Token.ts b/packages/contracts/test/ts/erc20Token.ts index 9aa93180b..1edcfcbbd 100644 --- a/packages/contracts/test/ts/erc20Token.ts +++ b/packages/contracts/test/ts/erc20Token.ts @@ -15,7 +15,10 @@ chaiSetup.configure(); const expect = chai.expect; contract('ERC20Token', (accounts: string[]) => { - const zeroEx = new ZeroEx(web3.currentProvider); + const config = { + networkId: constants.TESTRPC_NETWORK_ID, + }; + const zeroEx = new ZeroEx(web3.currentProvider, config); const owner = accounts[0]; const spender = accounts[1]; diff --git a/packages/contracts/test/ts/ether_token.ts b/packages/contracts/test/ts/ether_token.ts index dbb4d2ee6..79c618ec2 100644 --- a/packages/contracts/test/ts/ether_token.ts +++ b/packages/contracts/test/ts/ether_token.ts @@ -5,6 +5,7 @@ import * as chai from 'chai'; import Web3 = require('web3'); import {Artifacts} from '../../util/artifacts'; +import {constants} from '../../util/constants'; import {chaiSetup} from './utils/chai_setup'; @@ -22,11 +23,13 @@ contract('EtherToken', (accounts: string[]) => { const gasPrice = ZeroEx.toBaseUnitAmount(new BigNumber(20), 9); let zeroEx: ZeroEx; let etherTokenAddress: string; + before(async () => { etherTokenAddress = EtherToken.address; zeroEx = new ZeroEx(web3.currentProvider, { - gasPrice, - etherTokenContractAddress: etherTokenAddress, + gasPrice, + etherTokenContractAddress: etherTokenAddress, + networkId: constants.TESTRPC_NETWORK_ID, }); }); diff --git a/packages/contracts/test/ts/ether_token_v2.ts b/packages/contracts/test/ts/ether_token_v2.ts index 0c352b522..4931eb798 100644 --- a/packages/contracts/test/ts/ether_token_v2.ts +++ b/packages/contracts/test/ts/ether_token_v2.ts @@ -5,6 +5,7 @@ import promisify = require('es6-promisify'); import Web3 = require('web3'); import {Artifacts} from '../../util/artifacts'; +import {constants} from '../../util/constants'; import {chaiSetup} from './utils/chai_setup'; @@ -26,8 +27,9 @@ contract('EtherTokenV2', (accounts: string[]) => { const etherToken = await EtherTokenV2.new(); etherTokenAddress = etherToken.address; zeroEx = new ZeroEx(web3.currentProvider, { - gasPrice, - etherTokenContractAddress: etherTokenAddress, + gasPrice, + etherTokenContractAddress: etherTokenAddress, + networkId: constants.TESTRPC_NETWORK_ID, }); }); @@ -76,7 +78,7 @@ contract('EtherTokenV2', (accounts: string[]) => { const expectedFrom = ZeroEx.NULL_ADDRESS; const expectedTo = account; const expectedValue = ethToDeposit; - const logArgs = logs[0].args; + const logArgs = (logs[0] as any).args; expect(logArgs._from).to.equal(expectedFrom); expect(logArgs._to).to.equal(expectedTo); expect(logArgs._value).to.be.bignumber.equal(ethToDeposit); @@ -128,7 +130,7 @@ contract('EtherTokenV2', (accounts: string[]) => { const expectedFrom = account; const expectedTo = ZeroEx.NULL_ADDRESS; const expectedValue = ethTokensToWithdraw; - const logArgs = logs[0].args; + const logArgs = (logs[0] as any).args; expect(logArgs._from).to.equal(expectedFrom); expect(logArgs._to).to.equal(expectedTo); expect(logArgs._value).to.be.bignumber.equal(ethTokensToWithdraw); diff --git a/packages/contracts/test/ts/exchange/core.ts b/packages/contracts/test/ts/exchange/core.ts index 7f632c6e6..641084937 100644 --- a/packages/contracts/test/ts/exchange/core.ts +++ b/packages/contracts/test/ts/exchange/core.ts @@ -59,6 +59,7 @@ contract('Exchange', (accounts: string[]) => { exWrapper = new ExchangeWrapper(exchange); zeroEx = new ZeroEx(web3.currentProvider, { exchangeContractAddress: exchange.address, + networkId: constants.TESTRPC_NETWORK_ID, }); const [repAddress, dgdAddress, zrxAddress] = await Promise.all([ diff --git a/packages/contracts/test/ts/unlimitedAllowanceToken.ts b/packages/contracts/test/ts/unlimitedAllowanceToken.ts index ca3fcd7d2..3b4d2db77 100644 --- a/packages/contracts/test/ts/unlimitedAllowanceToken.ts +++ b/packages/contracts/test/ts/unlimitedAllowanceToken.ts @@ -4,6 +4,7 @@ import * as chai from 'chai'; import * as Web3 from 'web3'; import {Artifacts} from '../../util/artifacts'; +import {constants} from '../../util/constants'; import {ContractInstance} from '../../util/types'; import {chaiSetup} from './utils/chai_setup'; @@ -14,7 +15,10 @@ chaiSetup.configure(); const expect = chai.expect; contract('UnlimitedAllowanceToken', (accounts: string[]) => { - const zeroEx = new ZeroEx(web3.currentProvider); + const config = { + networkId: constants.TESTRPC_NETWORK_ID, + }; + const zeroEx = new ZeroEx(web3.currentProvider, config); const owner = accounts[0]; const spender = accounts[1]; diff --git a/packages/contracts/test/ts/zrxToken.ts b/packages/contracts/test/ts/zrxToken.ts index 471ee93f2..1c9655402 100644 --- a/packages/contracts/test/ts/zrxToken.ts +++ b/packages/contracts/test/ts/zrxToken.ts @@ -4,6 +4,7 @@ import * as chai from 'chai'; import Web3 = require('web3'); import {Artifacts} from '../../util/artifacts'; +import {constants} from '../../util/constants'; import {ContractInstance} from '../../util/types'; import {chaiSetup} from './utils/chai_setup'; @@ -25,9 +26,10 @@ contract('ZRXToken', (accounts: string[]) => { beforeEach(async () => { zeroEx = new ZeroEx(web3.currentProvider, { - exchangeContractAddress: Exchange.address, + exchangeContractAddress: Exchange.address, + networkId: constants.TESTRPC_NETWORK_ID, }); - zrxAddress = await zeroEx.exchange.getZRXTokenAddressAsync(); + zrxAddress = zeroEx.exchange.getZRXTokenAddress(); zrx = await ZRXToken.at(zrxAddress); MAX_UINT = zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS; }); diff --git a/packages/contracts/util/constants.ts b/packages/contracts/util/constants.ts index 733ad2312..c28a18e27 100644 --- a/packages/contracts/util/constants.ts +++ b/packages/contracts/util/constants.ts @@ -2,4 +2,5 @@ export const constants = { NULL_BYTES: '0x', INVALID_OPCODE: 'invalid opcode', REVERT: 'revert', + TESTRPC_NETWORK_ID: 50, }; @@ -2,13 +2,6 @@ # yarn lockfile v1 -"0x-json-schemas@^0.6.1": - version "0.6.6" - resolved "https://registry.yarnpkg.com/0x-json-schemas/-/0x-json-schemas-0.6.6.tgz#3852e639245474a14daa2f8c454ba83ca5df8a9c" - dependencies: - jsonschema "^1.2.0" - lodash.values "^4.3.0" - "0x.js@0.27.1": version "0.27.1" resolved "https://registry.yarnpkg.com/0x.js/-/0x.js-0.27.1.tgz#e0dff70e257efbb7f54dddb55dddf2dce0b971ab" @@ -29,24 +22,6 @@ uuid "^3.1.0" web3 "^0.20.0" -"0x.js@^0.22.6": - version "0.22.6" - resolved "https://registry.yarnpkg.com/0x.js/-/0x.js-0.22.6.tgz#bc3ff79b6d71f8cf7fae3c78b2c776cfa79c193a" - dependencies: - "0x-json-schemas" "^0.6.1" - bignumber.js "^4.1.0" - compare-versions "^3.0.1" - es6-promisify "^5.0.0" - ethereumjs-abi "^0.6.4" - ethereumjs-blockstream "^2.0.6" - ethereumjs-util "^5.1.1" - find-versions "^2.0.0" - js-sha3 "^0.6.1" - lodash "^4.17.4" - publish-release "^1.3.3" - uuid "^3.1.0" - web3 "^0.20.0" - "@0xproject/assert@^0.0.6": version "0.0.6" resolved "https://registry.yarnpkg.com/@0xproject/assert/-/assert-0.0.6.tgz#773616620314f40ace11a9c4c65cc95398d2c178" @@ -112,10 +87,6 @@ version "4.6.2" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.6.2.tgz#12cfaba693ba20f114ed5765467ff25fdf67ddb0" -"@types/isomorphic-fetch@^0.0.34": - version "0.0.34" - resolved "https://registry.yarnpkg.com/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz#3c3483e606c041378438e951464f00e4e60706d6" - "@types/jsonschema@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/jsonschema/-/jsonschema-1.1.1.tgz#08703dfe074010e8e829123111594af731f57b1a" @@ -1287,7 +1258,7 @@ big.js@^3.1.3: version "3.2.0" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" -bignumber.js@^4.0.2, bignumber.js@^4.1.0, bignumber.js@~4.1.0: +bignumber.js@^4.0.2, bignumber.js@~4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.1.0.tgz#db6f14067c140bd46624815a7916c92d9b6c24b1" @@ -2662,10 +2633,14 @@ diff@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" -diff@3.3.1, diff@^3.1.0, diff@^3.2.0: +diff@3.3.1, diff@^3.2.0: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" +diff@^3.1.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" + diffie-hellman@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" @@ -5076,8 +5051,8 @@ lolex@^1.6.0: resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.6.0.tgz#3a9a0283452a47d7439e72731b9e07d7386e49f6" lolex@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.3.0.tgz#d6bad0f0aa5caebffcfebb09fb2caa89baaff51c" + version "2.3.1" + resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.3.1.tgz#3d2319894471ea0950ef64692ead2a5318cff362" longest@^1.0.1: version "1.0.1" @@ -6472,7 +6447,7 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" -publish-release@0xproject/publish-release, publish-release@^1.3.3: +publish-release@0xproject/publish-release: version "1.3.3" resolved "https://codeload.github.com/0xproject/publish-release/tar.gz/c67c546726deecabd0cb35f9873afc912f862bd3" dependencies: @@ -7585,17 +7560,7 @@ sockjs@0.3.18: faye-websocket "^0.10.0" uuid "^2.0.2" -solc@0.4.11: - version "0.4.11" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.11.tgz#2522eb43e7c0419bac2060b96e20a2593bfb5e8b" - dependencies: - fs-extra "^0.30.0" - memorystream "^0.3.1" - require-from-string "^1.1.0" - semver "^5.3.0" - yargs "^4.7.1" - -solc@^0.4.18, solc@^0.4.2: +solc@0.4.18, solc@^0.4.18, solc@^0.4.2: version "0.4.18" resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.18.tgz#83ac6d871dd16a9710e67dbb76dad7f614100702" dependencies: @@ -8289,13 +8254,13 @@ truffle-hdwallet-provider@^0.0.3: web3 "^0.18.2" web3-provider-engine "^8.4.0" -truffle@3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/truffle/-/truffle-3.4.3.tgz#6d9ea4abea758b452b2d3769669eb7109146229e" +truffle@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/truffle/-/truffle-4.0.1.tgz#d8661a4ad7a6ca094b7517d29b199c60e6dde665" dependencies: mocha "^3.4.2" original-require "^1.0.1" - solc "0.4.11" + solc "0.4.18" tslib@^1.7.1: version "1.8.0" |