Repository navigation
fix: Preserve subaccount in neuron-manage --disburse-maturity-to; release 0.5.8 - #291
Merged
Merged
Conversation
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>
|
✅ 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
|
There was a problem hiding this comment.
🟢 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>
lwshang
approved these changes
Nov 30, 2026
lwshang
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Verified the new golden test fails on the pre-fix code (subaccount = null) and passes with the fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
neuron-manage --disburse-maturity-toignored the subaccount of the destination account, so maturity was minted to the owner's default subaccount.neuron-managenow builds its messages with theic_nns_governance_apitypes (which matchgovernance.did) instead of the internalpbtypes. Encoding of all otherneuron-managecommands is unchanged; no existing golden output changed.neuron-stakealso moves to the API types. Its encoding is unchanged (same shape), but quill no longer sends governance any message built frompbtypes.🤖 Generated with Claude Code