From 892d2957751e7915bbed66fb881f1c0dc0ab5111 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 47ec3ed0a28..04fc682122f 100644 --- a/packages/workflow-compile/index.js +++ b/packages/workflow-compile/index.js @@ -109,9 +109,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({ @@ -120,10 +117,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); } };