aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/migrate.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-16 23:59:02 +0800
committerFabio Berger <me@fabioberger.com>2018-10-16 23:59:02 +0800
commitc84c92663d1ce0227b755dc861f825c35a3c7999 (patch)
tree3800297ba0072233fe88839b675e33e6b44f9649 /packages/migrations/src/migrate.ts
parent55a3bc8cb6772802672f60f22c5ed5c7e1b2dfdd (diff)
parentc333d093b585fa0250a6973f2d396eb3cf227334 (diff)
downloaddexon-0x-contracts-c84c92663d1ce0227b755dc861f825c35a3c7999.tar.gz
dexon-0x-contracts-c84c92663d1ce0227b755dc861f825c35a3c7999.tar.zst
dexon-0x-contracts-c84c92663d1ce0227b755dc861f825c35a3c7999.zip
Merge branch 'dev-section-redesign' into reSkinReferenceDocs
* dev-section-redesign: (87 commits) Added note about restriction on `testDirectory` fix(dev-utils): Make chai a dev dependency since exported interface depends on it Add changelog entries fix(subproviders): make web3-provider-engine types a 'dependency' so it's available to users of the library fix(sra-spec): make @loopback/openapi-v3-types a 'dependency' so it's available to users of the library fix(sol-cov): make @types/solidity-parser-antlr a 'dependency' so it's available to users of the library fix(dev-utils): make web3-provider-engine types a 'dependency' so it's available to users of the library fix(0x.js): make web3-provider-engine types a 'dependency' so it's available to users of the library fix(monorepo-scripts): Move the creation of the `.installation-test` directory OUTSIDE of the monorepo root, so that the installed packages can't reference the hoisted node_modules folder Remove ContractNotFound errors in contract-wrappers Update prettierignore Update website to use the new unsubscribeAll method in contract-wrappers In abi-gen-wrappers, ./wrappers -> ./src/generated-wrappers In contract-wrappers, remove setProvider and add unsubscribeAll method. take out explicit children definition in props Update json-schemas for contract-wrappers Add OrThrow suffix to getContractAddressesForNetwork remove unused import Update CHANGELOG.json for all changed packages Remove ContractAddresses from packages/types (mistake after rebase) ...
Diffstat (limited to 'packages/migrations/src/migrate.ts')
-rw-r--r--packages/migrations/src/migrate.ts39
1 files changed, 8 insertions, 31 deletions
diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts
index 338832feb..27f36ba34 100644
--- a/packages/migrations/src/migrate.ts
+++ b/packages/migrations/src/migrate.ts
@@ -2,43 +2,20 @@
import { devConstants, web3Factory } from '@0xproject/dev-utils';
import { logUtils } from '@0xproject/utils';
import { Provider } from 'ethereum-types';
-import * as yargs from 'yargs';
-import { runV1MigrationsAsync } from './1.0.0/migration';
-import { runV2MigrationsAsync } from './2.0.0/migration';
-
-enum ContractVersions {
- V1 = '1.0.0',
- V2 = '2.0.0',
-}
-const args = yargs.argv;
+import { runMigrationsAsync } from './migration';
(async () => {
- const contractsVersion = args.contractsVersion;
- const artifactsDir = `artifacts/${contractsVersion}`;
let providerConfigs;
let provider: Provider;
let txDefaults;
- switch (contractsVersion) {
- case ContractVersions.V1:
- providerConfigs = { shouldUseInProcessGanache: false };
- provider = web3Factory.getRpcProvider(providerConfigs);
- txDefaults = {
- from: devConstants.TESTRPC_FIRST_ADDRESS,
- };
- await runV1MigrationsAsync(provider, artifactsDir, txDefaults);
- break;
- case ContractVersions.V2:
- providerConfigs = { shouldUseInProcessGanache: false };
- provider = web3Factory.getRpcProvider(providerConfigs);
- txDefaults = {
- from: devConstants.TESTRPC_FIRST_ADDRESS,
- };
- await runV2MigrationsAsync(provider, artifactsDir, txDefaults);
- break;
- default:
- throw new Error(`Unsupported contract version: ${contractsVersion}`);
- }
+
+ providerConfigs = { shouldUseInProcessGanache: false };
+ provider = web3Factory.getRpcProvider(providerConfigs);
+ txDefaults = {
+ from: devConstants.TESTRPC_FIRST_ADDRESS,
+ };
+ await runMigrationsAsync(provider, txDefaults);
process.exit(0);
})().catch(err => {
logUtils.log(err);