From a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 10 May 2018 15:09:33 +0200 Subject: Add a check for compiler output --- packages/contract_templates/contract.handlebars | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/contract_templates/contract.handlebars') diff --git a/packages/contract_templates/contract.handlebars b/packages/contract_templates/contract.handlebars index 0f6151690..1fa9508f5 100644 --- a/packages/contract_templates/contract.handlebars +++ b/packages/contract_templates/contract.handlebars @@ -46,6 +46,9 @@ export class {{contractName}}Contract extends BaseContract { defaults: Partial, {{> typed_params inputs=ctor.inputs}} ): Promise<{{contractName}}Contract> { + if (_.isUndefined(artifact.compilerOutput)) { + throw new Error('Compiler output not found in the artifact file'); + } const bytecode = artifact.compilerOutput.evm.bytecode.object; const abi = artifact.compilerOutput.abi; return {{contractName}}Contract.deployAsync(bytecode, abi, provider, defaults, {{> params inputs=ctor.inputs}}); -- cgit v1.2.3