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

fix: Rename refresh-followers to refresh-following #257

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- `--refresh-followers` has been renamed to the more accurate `--refresh-following`.

## [0.5.3] - 2025-01-06

- Added `quill neuron-manage --refresh-followers`.
Expand Down
52 changes: 26 additions & 26 deletions docs/cli-reference/quill-neuron-manage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ quill neuron-manage [option] <neuron id>

## Flags

| Flag | Description |
|-------------------------------------------------------|----------------------------------------------------------------------------------|
| `--add-hot-key <ADD_HOT_KEY>` | Principal to be used as a hot key. |
| `-a`, `--additional-dissolve-delay-seconds <SECONDS>` | Number of dissolve seconds to add. |
| `--auto-stake-maturity enabled|disabled` | Set whether new maturity should be automatically staked. |
| `--clear-manage-neuron-followees` | Remove all followees for the NeuronManagement topic. |
| `--disburse-amount` | Disburse only the selected amount. |
| `--disburse-to` | Disburse to the selected NNS account instead of the controller. |
| `--disburse` | Disburse the entire staked amount to the controller's account. |
| `--follow-neurons <FOLLOW_NEURONS>...` | Defines the neuron ids of a follow rule. |
| `--follow-topic <FOLLOW_TOPIC>` | Defines the topic of a follow rule as defined [here][follow-rules]. |
| `-h`, `--help` | Displays usage information. |
| `--join-community-fund` | Join the Internet Computer's community fund with this neuron's entire stake. |
| `--leave-community-fund` | Leave the Internet Computer's community fund. |
| `--merge-from-neuron <MERGE_FROM_NEURON>` | Merge stake, maturity and age from the specified neuron into the managed neuron. |
| `--refresh-followers` | Refresh the neuron's voting power by reaffirming the current list of followers. |
| `--register-vote <PROPOSAL_ID>... [--reject]` | Vote to approve (default) or reject proposal(s). |
| `--reject` | Reject the proposal(s) specified with `--register-vote`. |
| `--remove-hot-key <REMOVE_HOT_KEY>` | Principal hot key to be removed. |
| `--set-visibility [public|private]` | Set visibility. This controls what fields are readable to arbitrary principals. |
| `--spawn` | Spawn rewards to a new neuron under the controller's account. |
| `--split <SPLIT>` | Split off the given number of ICP from a neuron. |
| `--stake-maturity <STAKE_MATURITY>` | Stake the percentage (between 1 and 100) of the maturity of a neuron. |
| `--start-dissolving` | Start dissolving. |
| `--stop-dissolving` | Stop dissolving. |
| Flag | Description |
|-------------------------------------------------------|----------------------------------------------------------------------------------------|
| `--add-hot-key <ADD_HOT_KEY>` | Principal to be used as a hot key. |
| `-a`, `--additional-dissolve-delay-seconds <SECONDS>` | Number of dissolve seconds to add. |
| `--auto-stake-maturity enabled|disabled` | Set whether new maturity should be automatically staked. |
| `--clear-manage-neuron-followees` | Remove all followees for the NeuronManagement topic. |
| `--disburse-amount` | Disburse only the selected amount. |
| `--disburse-to` | Disburse to the selected NNS account instead of the controller. |
| `--disburse` | Disburse the entire staked amount to the controller's account. |
| `--follow-neurons <FOLLOW_NEURONS>...` | Defines the neuron ids of a follow rule. |
| `--follow-topic <FOLLOW_TOPIC>` | Defines the topic of a follow rule as defined [here][follow-rules]. |
| `-h`, `--help` | Displays usage information. |
| `--join-community-fund` | Join the Internet Computer's community fund with this neuron's entire stake. |
| `--leave-community-fund` | Leave the Internet Computer's community fund. |
| `--merge-from-neuron <MERGE_FROM_NEURON>` | Merge stake, maturity and age from the specified neuron into the managed neuron. |
| `--refresh-following` | Refresh the neuron's voting power by reaffirming the current list of followed neurons. |
| `--register-vote <PROPOSAL_ID>... [--reject]` | Vote to approve (default) or reject proposal(s). |
| `--reject` | Reject the proposal(s) specified with `--register-vote`. |
| `--remove-hot-key <REMOVE_HOT_KEY>` | Principal hot key to be removed. |
| `--set-visibility [public|private]` | Set visibility. This controls what fields are readable to arbitrary principals. |
| `--spawn` | Spawn rewards to a new neuron under the controller's account. |
| `--split <SPLIT>` | Split off the given number of ICP from a neuron. |
| `--stake-maturity <STAKE_MATURITY>` | Stake the percentage (between 1 and 100) of the maturity of a neuron. |
| `--start-dissolving` | Start dissolving. |
| `--stop-dissolving` | Stop dissolving. |

[follow-rules]: https://github.com/dfinity/ic/blob/4c9e71499d90d00da986dbe7b985d861fd031c4e/rs/nns/governance/gen/ic_nns_governance.pb.v1.rs#L1571-L1632

Expand Down Expand Up @@ -99,7 +99,7 @@ This will produce a response like:
If a neuron does not take any action for more than 6 months, it will start losing voting power and thus voting rewards. To avoid that, neurons can vote directly or set which neurons they follow. To confirm the current following setting and refresh voting power without making any changes:

```sh
quill neuron-manage 2313380519530470538 --refresh-followers
quill neuron-manage 2313380519530470538 --refresh-following
```

This will produce a response like:
Expand Down
10 changes: 5 additions & 5 deletions src/commands/neuron_manage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ pub struct ManageOpts {
#[arg(long)]
set_visibility: Option<NativeVisibility>,

/// Refresh the neuron's voting power by reaffirming the current list of followers.
/// Refresh the neuron's voting power by reaffirming the current list of followed neurons.
/// This must be done every so often to avoid neurons diminishing in voting power.
#[arg(long)]
refresh_followers: bool,
#[arg(long, alias = "refresh-followers")]
refresh_following: bool,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
Expand All @@ -158,7 +158,7 @@ pub fn exec(auth: &AuthInfo, opts: ManageOpts) -> AnyhowResult<Vec<IngressWithRe
opts.add_hot_key.is_none() && opts.remove_hot_key.is_none() && !opts.disburse && opts.disburse_amount.is_none() && opts.disburse_to.is_none()
&& !opts.clear_manage_neuron_followees && !opts.join_community_fund && !opts.leave_community_fund
&& opts.follow_topic.is_none() && opts.follow_neurons.is_none() && opts.register_vote.is_none() && !opts.reject
&& opts.set_visibility.is_none() && !opts.refresh_followers,
&& opts.set_visibility.is_none() && !opts.refresh_following,
"\
Cannot use --ledger with these flags. This version of quill only supports the following neuron-manage operations with a Ledger device:
--additional-dissolve-delay-seconds, --start-dissolving, --stop-dissolving, --split, --merge-from-neuron, --spawn, --stake-maturity, --auto-stake-maturity"
Expand Down Expand Up @@ -422,7 +422,7 @@ Cannot use --ledger with these flags. This version of quill only supports the fo
msgs.push(args);
}

if opts.refresh_followers {
if opts.refresh_following {
let args = Encode!(&ManageNeuron {
command: Some(Command::RefreshVotingPower(RefreshVotingPower {})),
neuron_id_or_subaccount: id.clone(),
Expand Down
6 changes: 3 additions & 3 deletions tests/output/neuron_manage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn set_visibility() {
}

#[test]
fn refresh_followers() {
quill_send(&format!("neuron-manage {NEURON_ID} --refresh-followers"))
.diff("neuron_manage/refresh_followers.txt")
fn refresh_following() {
quill_send(&format!("neuron-manage {NEURON_ID} --refresh-following"))
.diff("neuron_manage/refresh_following.txt")
}