From 4d9029bb0e3b215efdf165704c80d3bacef0e85a Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 28 Mar 2018 11:05:36 +0200 Subject: Add metacoin example project --- packages/deployer/CHANGELOG.json | 12 +++++++++- packages/deployer/solc_bin/.gitkeep | 0 packages/deployer/src/compiler.ts | 5 ++++ packages/deployer/src/globals.d.ts | 46 ------------------------------------- packages/deployer/tsconfig.json | 7 +----- 5 files changed, 17 insertions(+), 53 deletions(-) create mode 100644 packages/deployer/solc_bin/.gitkeep (limited to 'packages/deployer') diff --git a/packages/deployer/CHANGELOG.json b/packages/deployer/CHANGELOG.json index bf8c09f5f..cc0d8b7cf 100644 --- a/packages/deployer/CHANGELOG.json +++ b/packages/deployer/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "0.3.5", + "changes": [ + { + "note": "Don't try to write contract artifact if the error occured", + "pr": 485 + } + ] + }, { "version": "0.3.4", "changes": [ @@ -7,7 +16,8 @@ "pr": 491 } ], - "timestamp": 1522658513 + "timestamp": 1522658513, + "isPublished": true }, { "version": "0.3.1", diff --git a/packages/deployer/solc_bin/.gitkeep b/packages/deployer/solc_bin/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 219a55c32..b63f6033f 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -179,10 +179,15 @@ export class Compiler { ); if (!_.isUndefined(compiled.errors)) { + const isError = (errorOrWarning: string) => !errorOrWarning.includes('Warning'); + const errors = _.filter(compiled.errors, isError); _.forEach(compiled.errors, errMsg => { const normalizedErrMsg = getNormalizedErrMsg(errMsg); this._solcErrors.add(normalizedErrMsg); }); + if (!_.isEmpty(errors)) { + return; + } } const contractName = path.basename(fileName, constants.SOLIDITY_FILE_EXTENSION); const contractIdentifier = `${fileName}:${contractName}`; diff --git a/packages/deployer/src/globals.d.ts b/packages/deployer/src/globals.d.ts index 5b0d495d5..94e63a32d 100644 --- a/packages/deployer/src/globals.d.ts +++ b/packages/deployer/src/globals.d.ts @@ -1,49 +1,3 @@ -declare module 'dirty-chai'; - -// tslint:disable:completed-docs -declare module 'solc' { - export interface ContractCompilationResult { - srcmap: string; - srcmapRuntime: string; - bytecode: string; - runtimeBytecode: string; - interface: string; - } - export interface CompilationResult { - errors: string[]; - contracts: { - [contractIdentifier: string]: ContractCompilationResult; - }; - sources: { - [sourceName: string]: { - AST: any; - }; - }; - sourceList: string[]; - } - export interface ImportContents { - contents: string; - } - export interface InputSources { - sources: { - [fileName: string]: string; - }; - } - export interface SolcInstance { - compile( - sources: InputSources, - optimizerEnabled: number, - findImports: (importPath: string) => ImportContents, - ): CompilationResult; - } - export function loadRemoteVersion(versionName: string, cb: (err: Error | null, res?: SolcInstance) => void): void; - export function setupMethods(solcBin: any): SolcInstance; -} - -declare module 'web3-eth-abi' { - export function encodeParameters(typesArray: string[], parameters: any[]): string; -} - declare module '*.json' { const json: any; /* tslint:disable */ diff --git a/packages/deployer/tsconfig.json b/packages/deployer/tsconfig.json index a4cbc37c5..63cbc75c3 100644 --- a/packages/deployer/tsconfig.json +++ b/packages/deployer/tsconfig.json @@ -4,10 +4,5 @@ "outDir": "lib", "strictFunctionTypes": false }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } -- cgit v1.2.3