From 88fb88f196d659b5b8033f213e4ceadc17a8ace8 Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Wed, 11 Nov 2020 20:43:46 -0500 Subject: [PATCH] Ensure artifacts are saved with db info --- packages/workflow-compile/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/workflow-compile/index.js b/packages/workflow-compile/index.js index 4514f092183..ef0b67a013a 100644 --- a/packages/workflow-compile/index.js +++ b/packages/workflow-compile/index.js @@ -115,9 +115,6 @@ const WorkflowCompile = { await fse.ensureDir(config.contracts_build_directory); - const artifacts = contracts.map(Shims.NewToLegacy.forContract); - await config.artifactor.saveAll(artifacts); - if (options.db && options.db.enabled === true && contracts.length > 0) { const db = connect(config); const project = await Project.initialize({ @@ -126,10 +123,13 @@ const WorkflowCompile = { directory: config.working_directory } }); - await project.loadCompile({ + ({contracts} = await project.loadCompile({ result: {contracts, compilations} - }); + })); } + + const artifacts = contracts.map(Shims.NewToLegacy.forContract); + await config.artifactor.saveAll(artifacts); } };