diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-20 05:58:06 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-20 05:58:06 +0800 |
commit | 41104b2d457b9b662122c139ee83bb8d0f519a51 (patch) | |
tree | 4743803be2564e0e5221b9a41e2c293a6fe52dd9 /packages/contracts | |
parent | 2930537a512bdaa74181fea74ce6befdf5b305b4 (diff) | |
parent | c39ac903a972930d538f8fa3292c658201b1c5e5 (diff) | |
download | dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.gz dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.bz2 dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.lz dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.xz dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.zst dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.zip |
Merge branch 'development' into createWethPage
* development: (27 commits)
Remove re-assignment
Fix scrolling topBar on Portal
Fix overflow issue on calculated fillAmount
Fix faulty import
Introduce an identityCommandBuilder
Define types for methodID
Define types for ethereumjs-abi
Install types for yargs
Fix comments
Fix linter issues
Fix linter error
Rename SubscriptionOpts to BlockRange
Refactor remaining _.assign to spread operator
Move muiTheme into it's own module
Refactor configs and constants, standardize on uppercase/snakecase, alphebetize, rename for logical grouping
Sort colors into color spectrum
remove unused style
standarize on `grey` over `gray` spelling and other color related fixes
Standardize colors to always be in uppercase hex and consolidate material-ui greys
Consolidate all custom colors and material-ui colors into a colors module
...
# Conflicts:
# packages/website/ts/components/eth_wrappers.tsx
# packages/website/ts/components/portal.tsx
# packages/website/ts/utils/configs.ts
# packages/website/ts/utils/constants.ts
Diffstat (limited to 'packages/contracts')
-rw-r--r-- | packages/contracts/deploy/cli.ts | 15 | ||||
-rw-r--r-- | packages/contracts/deploy/src/utils/types.ts | 3 | ||||
-rw-r--r-- | packages/contracts/globals.d.ts | 8 | ||||
-rw-r--r-- | packages/contracts/package.json | 2 |
4 files changed, 16 insertions, 12 deletions
diff --git a/packages/contracts/deploy/cli.ts b/packages/contracts/deploy/cli.ts index 423523e21..b02849826 100644 --- a/packages/contracts/deploy/cli.ts +++ b/packages/contracts/deploy/cli.ts @@ -23,12 +23,12 @@ const DEFAULT_GAS_PRICE = ((10 ** 9) * 2).toString(); * Compiles all contracts with options passed in through CLI. * @param argv Instance of process.argv provided by yargs. */ -async function onCompileCommand(args: CliOptions): Promise<void> { +async function onCompileCommand(argv: CliOptions): Promise<void> { const opts: CompilerOptions = { - contractsDir: args.contractsDir, - networkId: args.networkId, - optimizerEnabled: args.shouldOptimize ? 1 : 0, - artifactsDir: args.artifactsDir, + contractsDir: argv.contractsDir, + networkId: argv.networkId, + optimizerEnabled: argv.shouldOptimize ? 1 : 0, + artifactsDir: argv.artifactsDir, }; await commands.compileAsync(opts); } @@ -113,6 +113,7 @@ function deployCommandBuilder(yargsInstance: any) { } (() => { + const identityCommandBuilder = _.identity; return yargs .option('contracts-dir', { type: 'string', @@ -150,11 +151,11 @@ function deployCommandBuilder(yargsInstance: any) { }) .command('compile', 'compile contracts', - _.noop, + identityCommandBuilder, onCompileCommand) .command('migrate', 'compile and deploy contracts using migration scripts', - _.noop, + identityCommandBuilder, onMigrateCommand) .command('deploy', 'deploy a single contract with provided arguments', diff --git a/packages/contracts/deploy/src/utils/types.ts b/packages/contracts/deploy/src/utils/types.ts index f6b9de6e9..6831079e6 100644 --- a/packages/contracts/deploy/src/utils/types.ts +++ b/packages/contracts/deploy/src/utils/types.ts @@ -1,5 +1,6 @@ import {TxData} from '@0xproject/types'; import * as Web3 from 'web3'; +import * as yargs from 'yargs'; export enum AbiType { Function = 'function', @@ -32,7 +33,7 @@ export interface SolcErrors { [key: string]: boolean; } -export interface CliOptions { +export interface CliOptions extends yargs.Arguments { artifactsDir: string; contractsDir: string; jsonrpcPort: number; diff --git a/packages/contracts/globals.d.ts b/packages/contracts/globals.d.ts index df53e9372..2e5827324 100644 --- a/packages/contracts/globals.d.ts +++ b/packages/contracts/globals.d.ts @@ -1,8 +1,5 @@ -declare module 'bn.js'; -declare module 'ethereumjs-abi'; declare module 'chai-bignumber'; declare module 'dirty-chai'; -declare module 'yargs'; // HACK: In order to merge the bignumber declaration added by chai-bignumber to the chai Assertion // interface we must use `namespace` as the Chai definitelyTyped definition does. Since we otherwise @@ -31,6 +28,11 @@ declare module 'web3-eth-abi' { export function encodeParameters(typesArray: string[], parameters: any[]): string; } +declare module 'ethereumjs-abi' { + const soliditySHA3: (argTypes: string[], args: any[]) => Buffer; + const methodID: (name: string, types: string[]) => Buffer; +} + // Truffle injects the following into the global scope declare var artifacts: any; declare var contract: any; diff --git a/packages/contracts/package.json b/packages/contracts/package.json index c8ccd0a3a..0a7b8f5ef 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -36,7 +36,7 @@ "@types/lodash": "^4.14.86", "@types/node": "^8.0.53", "@types/request-promise-native": "^1.0.2", - "@types/yargs": "^8.0.2", + "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", "chai-as-promised-typescript-typings": "^0.0.3", |