Skip to content

Commit

Permalink
handle edge case where old referenda are all removed, no new referendum
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Jan 2, 2024
1 parent 54ca3c3 commit bf5eff2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions polkadot-votebot-gov2-cron/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* A simple one-shot voteBot script for Polkadot
* Copyright 2022 MIDL.dev
* Copyright 2024 MIDL.dev
* All inputs come from environment variables:
*
Expand All @@ -9,7 +9,9 @@
* * STASH_ACCOUNT_ALIAS: an alias for your validator
* * VOTE_REPO: the github repository where your vote choices are kept in yaml format, for example midl-dev/dotsama-votes
*
* The script queries the current referendums, then try to vote for the oldest unvoted referendum. It does not vote for all. To do this, run this script several times.
* The script queries the current referendums, then try to vote for the oldest unvoted referendum.
*
* If there is no unvoted referendum, it queries the expired referenda. If there are any, it removes the votes.
*
* If voting extrinsic fails, it will post an error to the console and to Slack
*
Expand Down Expand Up @@ -246,6 +248,9 @@ async function main() {
console.log("No expired referenda, exiting.")
process.exit(0);
}
} else {
console.log("No expired referenda, exiting.")
process.exit(0);
}
}
}
Expand Down

0 comments on commit bf5eff2

Please sign in to comment.