diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-10 21:09:33 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-10 23:47:38 +0800 |
commit | a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73 (patch) | |
tree | 0bc81855dbad08379146f5d4046d43fe6b3284ab | |
parent | 62f1430a2c53cb983c28f156bd0dd6409821ad5a (diff) | |
download | dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.gz dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.bz2 dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.lz dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.xz dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.tar.zst dexon-sol-tools-a5fea3b9c3a004b5e2740a9a2d70eb3170aa6b73.zip |
Add a check for compiler output
-rw-r--r-- | packages/0x.js/test/global_hooks.ts | 2 | ||||
-rw-r--r-- | packages/0x.js/test/utils/constants.ts | 1 | ||||
-rw-r--r-- | packages/contract_templates/contract.handlebars | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/packages/0x.js/test/global_hooks.ts b/packages/0x.js/test/global_hooks.ts index b722ec6d9..3e6731add 100644 --- a/packages/0x.js/test/global_hooks.ts +++ b/packages/0x.js/test/global_hooks.ts @@ -13,6 +13,6 @@ before('migrate contracts', async function() { gas: devConstants.GAS_ESTIMATE, from: devConstants.TESTRPC_FIRST_ADDRESS, }; - const artifactsDir = `../migrations/artifacts/${constants.ARTIFACTS_VERSION}`; + const artifactsDir = `../migrations/artifacts/1.0.0`; await runMigrationsAsync(provider, artifactsDir, defaults); }); diff --git a/packages/0x.js/test/utils/constants.ts b/packages/0x.js/test/utils/constants.ts index cf5da464c..cf030259c 100644 --- a/packages/0x.js/test/utils/constants.ts +++ b/packages/0x.js/test/utils/constants.ts @@ -6,5 +6,4 @@ export const constants = { KOVAN_RPC_URL: 'https://kovan.infura.io/', ROPSTEN_RPC_URL: 'https://ropsten.infura.io/', ZRX_DECIMALS: 18, - ARTIFACTS_VERSION: '1.0.0', }; 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<TxData>, {{> 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}}); |