aboutsummaryrefslogtreecommitdiffstats
path: root/packages/migrations/src/migrate.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-25 07:31:21 +0800
committerFabio Berger <me@fabioberger.com>2018-05-25 07:31:21 +0800
commit4e5bfae332279acbb58d76a32102b5a27dde069d (patch)
treee613c1a5ebba642a171f0817ef8c336088091543 /packages/migrations/src/migrate.ts
parent662dc1287737aa02c0c822d7c53be114230422c0 (diff)
parent895a9093aa5f204f9f7ad0fedb2934a8b6c40b17 (diff)
downloaddexon-sol-tools-4e5bfae332279acbb58d76a32102b5a27dde069d.tar
dexon-sol-tools-4e5bfae332279acbb58d76a32102b5a27dde069d.tar.gz
dexon-sol-tools-4e5bfae332279acbb58d76a32102b5a27dde069d.tar.bz2
dexon-sol-tools-4e5bfae332279acbb58d76a32102b5a27dde069d.tar.lz
dexon-sol-tools-4e5bfae332279acbb58d76a32102b5a27dde069d.tar.xz
dexon-sol-tools-4e5bfae332279acbb58d76a32102b5a27dde069d.tar.zst
dexon-sol-tools-4e5bfae332279acbb58d76a32102b5a27dde069d.zip
Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype: Temporarily disable installation tests Use domain separator for exchange address publicGetOrderSchemaHash -> getOrderSchemaHash Update order hash to match latest eip712 Pin connect in sra-report Fix a typo Pin types in sra-report Fix linter issues Unpin types version in @0xproject/connect Pin types version in website Do a fake version bump on types so that yarn doesn't try to install updated version for not yet migrated packages Migrate migrations to v2
Diffstat (limited to 'packages/migrations/src/migrate.ts')
-rw-r--r--packages/migrations/src/migrate.ts19
1 files changed, 16 insertions, 3 deletions
diff --git a/packages/migrations/src/migrate.ts b/packages/migrations/src/migrate.ts
index 1230f376e..49b4e897c 100644
--- a/packages/migrations/src/migrate.ts
+++ b/packages/migrations/src/migrate.ts
@@ -3,8 +3,16 @@ import { devConstants, web3Factory } from '@0xproject/dev-utils';
import { Provider } from '@0xproject/types';
import { logUtils } from '@0xproject/utils';
import * as path from 'path';
+import * as yargs from 'yargs';
-import { runMigrationsAsync } from './migration';
+import { runV1MigrationsAsync } from './v1/migration';
+import { runV2MigrationsAsync } from './v2/migration';
+
+enum ContractVersions {
+ V1 = '1.0.0',
+ V2 = '2.0.0',
+}
+const args = yargs.argv;
(async () => {
const txDefaults = {
@@ -12,8 +20,13 @@ import { runMigrationsAsync } from './migration';
};
const providerConfigs = { shouldUseInProcessGanache: false };
const provider: Provider = web3Factory.getRpcProvider(providerConfigs);
- const artifactsDir = 'artifacts/1.0.0';
- await runMigrationsAsync(provider, artifactsDir, txDefaults);
+ const contractsVersion = args.contractsVersion;
+ const artifactsDir = `artifacts/${contractsVersion}`;
+ if (contractsVersion === ContractVersions.V1) {
+ await runV1MigrationsAsync(provider, artifactsDir, txDefaults);
+ } else {
+ await runV2MigrationsAsync(provider, artifactsDir, txDefaults);
+ }
process.exit(0);
})().catch(err => {
logUtils.log(err);