Skip to content

fix: Preserve subaccount in neuron-manage --disburse-maturity-to; release 0.5.8 - #291

Merged
lwshang merged 2 commits into
masterfrom
fix/disburse-maturity-subaccount
Nov 30, 2026
Merged

lwshang merged 2 commits into
masterfrom
fix/disburse-maturity-subaccount

Conversation

@raymondk

@raymondk raymondk commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

neuron-manage --disburse-maturity-to ignored the subaccount of the destination account, so maturity was minted to the owner's default subaccount.

  • neuron-manage now builds its messages with the ic_nns_governance_api types (which match governance.did) instead of the internal pb types. Encoding of all other neuron-manage commands is unchanged; no existing golden output changed.
  • neuron-stake also moves to the API types. Its encoding is unchanged (same shape), but quill no longer sends governance any message built from pb types.
  • Adds a unit test and a golden-output test for a destination with a non-default subaccount.
  • Release 0.5.8.

🤖 Generated with Claude Code

neuron-manage now builds its messages with the ic_nns_governance_api
types, which match governance.did, instead of the internal pb types.
With the pb types, the subaccount of a --disburse-maturity-to account
was not encoded in the shape governance expects and was ignored.

Adds a unit test and a golden-output test for a destination with a
non-default subaccount.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raymondk
raymondk requested a review from a team as a code owner November 28, 2026 02:26
Copilot AI balanced review requested due to automatic review settings November 28, 2026 02:26
@zeropath-ai

zeropath-ai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed 1 of 4 changed files in the new commits (3 skipped) up to d61eb74.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► src/commands/neuron_manage.rs
    Implement Vercel OAuth Flow
Enhancement ► src/commands/neuron_manage.rs
    Refactor to use ic_nns_governance_api types and adjust handling of ManageNeuron commands
Enhancement ► src/commands/neuron_manage.rs
    Add wiring to build manage_neuron messages and keep subaccounts in DisburseMaturity to_account
Enhancement ► src/commands/neuron_stake.rs
    Align imports to use ic_nns_governance_api types and comments referencing neuron_manage.rs
Enhancement ► tests/output/default/neuron_manage/disburse_maturity_to_subaccount.txt
    Add expected output for subaccount preservation in disburse maturity flow
Enhancement ► tests/output/neuron_manage.rs
    Add test case demonstrating subaccount persists in DisburseMaturity

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the change to preserve destination subaccounts in maturity disbursement requests.

No open issues 🎉

What changed in this PR

This PR fixes neuron-manage --disburse-maturity-to dropping destination subaccounts by using the public governance API types for Candid encoding.

Changes:

  • Preserves ICRC-1 destination subaccounts in maturity disbursement requests.
  • Extracts argument construction and adds unit and golden-output regression coverage.
  • Documents the fix in the changelog.
File Description
tests/​output/​neuron_manage.rs Adds a golden-output case with a non-default destination subaccount.
tests/​output/​default/​neuron_manage/​disburse_maturity_to_subaccount.txt Records the expected request containing the destination subaccount.
src/​commands/​neuron_manage.rs Uses public API types, preserves subaccount bytes, and adds a regression unit test.
CHANGELOG.md Documents the destination-subaccount fix.

Review effort: Balanced

neuron-stake now builds its manage_neuron message with the
ic_nns_governance_api types, like neuron-manage. The encoding is
unchanged (the ClaimOrRefresh types have the same shape), but quill no
longer sends governance any message built from the internal pb types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 30, 2026 06:08
@lwshang lwshang changed the title fix: Preserve subaccount in neuron-manage --disburse-maturity-to fix: Preserve subaccount in neuron-manage --disburse-maturity-to; release 0.5.8 Nov 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the destination subaccount preservation fix.

No open issues 🎉

Review effort: Balanced

@lwshang lwshang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Verified the new golden test fails on the pre-fix code (subaccount = null) and passes with the fix.

@lwshang
lwshang merged commit 3568ace into master Nov 30, 2026
35 checks passed
@lwshang
lwshang deleted the fix/disburse-maturity-subaccount branch November 30, 2026 06:23
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.

3 participants