From e183dc30ee30240fabcba8e791dfa37c5c82aa95 Mon Sep 17 00:00:00 2001 From: Tom Beynon Date: Mon, 8 Apr 2024 14:38:44 +0100 Subject: [PATCH] Fix network name logging --- src/autostake/index.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/autostake/index.mjs b/src/autostake/index.mjs index 6f8c5081..5be6937b 100644 --- a/src/autostake/index.mjs +++ b/src/autostake/index.mjs @@ -40,6 +40,7 @@ export default function Autostake(mnemonic, opts) { const health = new Health(data.healthCheck, { dryRun: opts.dryRun, networkName: data.name }) health.started('⚛') const results = await runWithRetry(data, health) + const network = results[0]?.networkRunner?.network const { success, skipped } = results[results.length - 1] || {} if(!skipped && !failed){ health.log(`Autostake ${success ? 'completed' : 'failed'} after ${results.length} attempt(s)`) @@ -49,9 +50,9 @@ export default function Autostake(mnemonic, opts) { }) } if (success || skipped) { - return health.success(`Autostake finished for ${data.prettyName}`) + return health.success(`Autostake finished for ${network?.prettyName || data.name}`) } else { - return health.failed(`Autostake failed for ${data.prettyName}`) + return health.failed(`Autostake failed for ${network?.prettyName || data.name}`) } } })