aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-12-18 23:27:14 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-12-19 19:19:48 +0800
commita5d2cbfd6f9d7e86807bf2c4fb3a045722153e58 (patch)
treee0fb3f23d518b1d015259f9bca38e844f3761e4e /packages/contracts
parent04268d7f4b4a8a3496518a450bfcf01bb056a57e (diff)
downloaddexon-0x-contracts-a5d2cbfd6f9d7e86807bf2c4fb3a045722153e58.tar.gz
dexon-0x-contracts-a5d2cbfd6f9d7e86807bf2c4fb3a045722153e58.tar.zst
dexon-0x-contracts-a5d2cbfd6f9d7e86807bf2c4fb3a045722153e58.zip
Install types for yargs
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/deploy/cli.ts14
-rw-r--r--packages/contracts/deploy/src/utils/types.ts3
-rw-r--r--packages/contracts/globals.d.ts1
-rw-r--r--packages/contracts/package.json2
4 files changed, 10 insertions, 10 deletions
diff --git a/packages/contracts/deploy/cli.ts b/packages/contracts/deploy/cli.ts
index 423523e21..6587e46f1 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);
}
@@ -150,11 +150,11 @@ function deployCommandBuilder(yargsInstance: any) {
})
.command('compile',
'compile contracts',
- _.noop,
+ _.identity,
onCompileCommand)
.command('migrate',
'compile and deploy contracts using migration scripts',
- _.noop,
+ _.identity,
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..a2d5176f8 100644
--- a/packages/contracts/globals.d.ts
+++ b/packages/contracts/globals.d.ts
@@ -2,7 +2,6 @@ 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
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",