diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-11 18:12:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-11 18:12:39 +0800 |
commit | f42f608f3f97a5244f09f17ae5ee184c0f775de3 (patch) | |
tree | 08fd03d69f8a7dfcc7beadcd56c5d1624928c430 /packages/0x.js | |
parent | 44f17c1706e7b3208fdc0702c54a8cd943132fd3 (diff) | |
parent | c093aab350dfbd86972d6388c3923ec60fc4501a (diff) | |
download | dexon-sol-tools-f42f608f3f97a5244f09f17ae5ee184c0f775de3.tar dexon-sol-tools-f42f608f3f97a5244f09f17ae5ee184c0f775de3.tar.gz dexon-sol-tools-f42f608f3f97a5244f09f17ae5ee184c0f775de3.tar.bz2 dexon-sol-tools-f42f608f3f97a5244f09f17ae5ee184c0f775de3.tar.lz dexon-sol-tools-f42f608f3f97a5244f09f17ae5ee184c0f775de3.tar.xz dexon-sol-tools-f42f608f3f97a5244f09f17ae5ee184c0f775de3.tar.zst dexon-sol-tools-f42f608f3f97a5244f09f17ae5ee184c0f775de3.zip |
Merge pull request #574 from 0xProject/feature/rm-rf-deployer
Remove @0xproject/deployer.Deployer. Make contracts able to deploy themselves
Diffstat (limited to 'packages/0x.js')
-rw-r--r-- | packages/0x.js/package.json | 8 | ||||
-rw-r--r-- | packages/0x.js/src/0x.ts | 4 | ||||
-rw-r--r-- | packages/0x.js/test/global_hooks.ts | 17 | ||||
-rw-r--r-- | packages/0x.js/test/utils/deployer.ts | 18 | ||||
-rw-r--r-- | packages/0x.js/test/utils/fill_scenarios.ts | 1 |
5 files changed, 19 insertions, 29 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index a23e01938..dafd8af88 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -16,15 +16,14 @@ "prebuild": "run-s clean generate_contract_wrappers", "build": "run-p build:umd:prod build:commonjs; exit 0;", "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/compact_artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'", - "lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'", + "lint": "tslint --project .", "test:circleci": "run-s test:coverage", "test": "run-s clean test:commonjs", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", - "update_artifacts": "for i in ${npm_package_config_contracts}; do copyfiles -u 4 ../migrations/artifacts/1.0.0/$i.json test/artifacts; done;", "clean": "shx rm -rf _bundles lib test_temp scripts", "build:umd:prod": "NODE_ENV=production webpack", - "build:commonjs": "tsc && yarn update_artifacts && copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/src/compact_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", + "build:commonjs": "tsc && copyfiles -u 2 './src/compact_artifacts/**/*.json' ./lib/src/compact_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "test:commonjs": "run-s build:commonjs run_mocha", "run_mocha": "mocha lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit", "manual:postpublish": "yarn build; node ./scripts/postpublish.js", @@ -34,7 +33,6 @@ }, "config": { "compact_artifacts": "Exchange DummyToken ZRXToken Token EtherToken TokenTransferProxy TokenRegistry", - "contracts": "Exchange DummyToken ZRXToken Token WETH9 TokenTransferProxy MultiSigWallet MultiSigWalletWithTimeLock MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress MaliciousToken TokenRegistry Arbitrage EtherDelta AccountLevels", "postpublish": { "assets": [ "packages/0x.js/_bundles/index.js", @@ -61,7 +59,7 @@ "node": ">=6.0.0" }, "devDependencies": { - "@0xproject/deployer": "^0.4.3", + "@0xproject/sol-compiler": "^0.4.3", "@0xproject/dev-utils": "^0.4.1", "@0xproject/migrations": "^0.0.5", "@0xproject/monorepo-scripts": "^0.1.19", diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts index 78f9f6beb..f603ad644 100644 --- a/packages/0x.js/src/0x.ts +++ b/packages/0x.js/src/0x.ts @@ -144,10 +144,10 @@ export class ZeroEx { ]); const artifactJSONs = _.values(artifacts); const abiArrays = _.map(artifactJSONs, artifact => artifact.abi); - const defaults = { + const txDefaults = { gasPrice: config.gasPrice, }; - this._web3Wrapper = new Web3Wrapper(provider, defaults); + this._web3Wrapper = new Web3Wrapper(provider, txDefaults); _.forEach(abiArrays, abi => { this._web3Wrapper.abiDecoder.addABI(abi); }); diff --git a/packages/0x.js/test/global_hooks.ts b/packages/0x.js/test/global_hooks.ts index e3c986524..88f202761 100644 --- a/packages/0x.js/test/global_hooks.ts +++ b/packages/0x.js/test/global_hooks.ts @@ -1,7 +1,18 @@ +import { devConstants } from '@0xproject/dev-utils'; import { runMigrationsAsync } from '@0xproject/migrations'; +import * as path from 'path'; -import { deployer } from './utils/deployer'; +import { constants } from './utils/constants'; +import { provider } from './utils/web3_wrapper'; -before('migrate contracts', async () => { - await runMigrationsAsync(deployer); +before('migrate contracts', async function() { + // HACK: Since the migrations take longer then our global mocha timeout limit + // we manually increase it for this before hook. + this.timeout(20000); + const txDefaults = { + gas: devConstants.GAS_ESTIMATE, + from: devConstants.TESTRPC_FIRST_ADDRESS, + }; + const artifactsDir = `../migrations/artifacts/1.0.0`; + await runMigrationsAsync(provider, artifactsDir, txDefaults); }); diff --git a/packages/0x.js/test/utils/deployer.ts b/packages/0x.js/test/utils/deployer.ts deleted file mode 100644 index b092322e2..000000000 --- a/packages/0x.js/test/utils/deployer.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Deployer } from '@0xproject/deployer'; -import { devConstants } from '@0xproject/dev-utils'; -import * as path from 'path'; - -import { constants } from './constants'; - -import { provider } from './web3_wrapper'; - -const artifactsDir = path.resolve('test', 'artifacts'); -const deployerOpts = { - artifactsDir, - provider, - networkId: constants.TESTRPC_NETWORK_ID, - defaults: { - gas: devConstants.GAS_ESTIMATE, - }, -}; -export const deployer = new Deployer(deployerOpts); diff --git a/packages/0x.js/test/utils/fill_scenarios.ts b/packages/0x.js/test/utils/fill_scenarios.ts index 5a82a56d2..7f28c8af3 100644 --- a/packages/0x.js/test/utils/fill_scenarios.ts +++ b/packages/0x.js/test/utils/fill_scenarios.ts @@ -35,7 +35,6 @@ export class FillScenarios { const web3Wrapper = (this._zeroEx as any)._web3Wrapper as Web3Wrapper; for (const token of this._tokens) { if (token.symbol !== 'ZRX' && token.symbol !== 'WETH') { - const defaults = {}; const dummyToken = new DummyTokenContract( artifacts.DummyTokenArtifact.abi, token.address, |