diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-25 07:30:30 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-05-25 07:30:30 +0800 |
commit | 35121f0b780102f0235ab3d5f26441cbb3f090e9 (patch) | |
tree | 9f1e56a98683fbee69a6b5fc051dc81064643734 /packages/migrations/src/migrate.ts | |
parent | 3cc8af819c9f62f42e7cb3d03f896b35cfc10d05 (diff) | |
parent | c4a7574f7bd3939eac9417241144197bbb22edb1 (diff) | |
download | dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.tar.gz dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.tar.zst dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.zip |
Merge branch 'v2-prototype' into feature/contracts/eip712-order-hash
* v2-prototype:
Temporarily disable installation tests
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
# Conflicts:
# packages/contracts/src/utils/order_utils.ts
Diffstat (limited to 'packages/migrations/src/migrate.ts')
-rw-r--r-- | packages/migrations/src/migrate.ts | 19 |
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); |