From 50cc9bc90c316791cc343208ee94c5b8275ed47f Mon Sep 17 00:00:00 2001 From: Nicolas Ochem Date: Mon, 9 May 2022 10:03:39 -0700 Subject: [PATCH] do not alert when votebot transaction retracted --- .gitignore | 1 + polkadot-votebot-cron/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0e3f059..2391660 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ terraform/terraform.tfvars +.env diff --git a/polkadot-votebot-cron/index.ts b/polkadot-votebot-cron/index.ts index 2c371c8..d8ca68d 100644 --- a/polkadot-votebot-cron/index.ts +++ b/polkadot-votebot-cron/index.ts @@ -171,9 +171,12 @@ async function main() { console.log("extrinsic success in finalized block, exiting") process.exit(0); } - } else if (status.isInvalid || status.isDropped || status.isRetracted) { + } else if (status.isInvalid || status.isDropped) { let slackMessage = `Vote extrinsic failed for validator ${stash_alias}(${stash_account}) with error ${status}.`; sendErrorToSlackAndExit(slackMessage); + } else if (status.isRetracted) { + // fail the job but do not alert. It is likely the transaction will go through at next try. + process.exit(1) } })); }