-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CLI command to activate votes #1843
Conversation
Codecov Report
@@ Coverage Diff @@
## asaj/cli #1843 +/- ##
==========================================
Coverage ? 74.2%
==========================================
Files ? 278
Lines ? 7653
Branches ? 672
==========================================
Hits ? 5679
Misses ? 1857
Partials ? 117
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor comments
} | ||
} | ||
const txos = await election.activate(account) | ||
for (const txo of txos) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using concurrentMap
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @mcortesi's recommendation, intentionally doing this serially.
const accounts = await this.kit.contracts.getAccounts() | ||
const account = await accounts.voteSignerToAccount(res.flags.from) | ||
const txos = await election.revoke(account, res.flags.for, new BigNumber(res.flags.value)) | ||
for (const txo of txos) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto concurrentMap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @mcortesi's recommendation, intentionally doing this serially.
Description
This PR adds a CLI command to activate any pending votes for an account, with the option to poll until the epoch is over and the votes can be activated.
Tested
Manually via against ganache.
Related issues
Backwards compatibility
Backwards compatible