Skip to content
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

Activate votes from any account #140

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

timmoreton
Copy link
Contributor

Description

New --for parameter and matching plumbing in ContractKit to allow pending votes to be activated from any account, not just from msg.sender.

packages/cli/bin/run.js election:activate --help
Activate pending votes in validator elections to begin earning rewards. To earn rewards as a voter, it is required to activate your pending votes at some point after the end of the epoch in which they were made.

USAGE
  $ celocli election:activate --from <value> [--globalHelp] [--for <value>] [--wait]

FLAGS
  --for=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d   Optional: use this to activate votes for another address
  --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d  (required) Address sending transaction (and voter's address if --for not specified)
  --globalHelp                                       View all available global flags
  --wait                                             Wait until all pending votes can be activated

DESCRIPTION
  Activate pending votes in validator elections to begin earning rewards. To earn rewards as a voter, it is required to activate your pending votes at
  some point after the end of the epoch in which they were made.

EXAMPLES
  activate --from 0x4443d0349e8b3075cba511a0a87796597602a0f1

  activate --from 0x4443d0349e8b3075cba511a0a87796597602a0f1 --for 0x5409ed021d9299bf6814279a6a1411a7e866a631

  activate --from 0x4443d0349e8b3075cba511a0a87796597602a0f1 --wait

Other changes

None.

Tested

By activating votes on testnet and mainnet.

Related issues

Note.

Backwards compatibility

Yes. New parameter in ContractKit's ElectionWrapper activate method is optional.

Documentation

Updated CLI docs.

@timmoreton timmoreton requested a review from a team as a code owner February 13, 2024 23:08
Copy link

changeset-bot bot commented Feb 13, 2024

🦋 Changeset detected

Latest commit: 41cccbb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@celo/contractkit Minor
@celo/celocli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@aaronmgdr
Copy link
Member

This looks good

@aaronmgdr
Copy link
Member

@shazarre and i will QA this and then merge

@shazarre
Copy link
Contributor

We tested in on alfajores by voting for a validator and trying to activate using the new --for flag straight away and it worked as expected by giving us following message:

Pending votes not yet activatable. Consider using the --wait flag.

which means it accepted the flag just fine.

After this epoch ends we'll test the activation again.

@aaronmgdr
Copy link
Member

aaronmgdr commented Feb 15, 2024

testing for this made me realize is not easy to vote with fresh account

Copy link
Contributor

@shazarre shazarre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've just tested the second step, works as expected 👍

@arthurgousset arthurgousset merged commit 0ad9c01 into master Feb 16, 2024
18 checks passed
@arthurgousset arthurgousset deleted the timmoreton/timmoreton/activate3 branch February 16, 2024 11:38
@arthurgousset
Copy link
Contributor

Thanks for QAing the changes @aaronmgdr and @shazarre ! Appreciate it 💯
Merged the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants