-
Notifications
You must be signed in to change notification settings - Fork 348
feat(nns): Support disbursing maturity to an AccountIdentifier #5351
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
Conversation
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.
If this pull request changes the behavior of any canister owned by
the Governance team in an externally visible way, remember to
update the corresponding unreleased_changelog.md file(s).
To acknowldge this reminder (and unblock the PR), dismiss this
code review by going to the bottom of the pull request page, look
for where it says this bot is requesting changes, click the three
dots on the right, select "Dismiss review", and supply one of the
following reasons:
-
Done.
-
No canister behavior changes.
To be more precise, "externally visible behavior change" usually
means that responses differ in some way. However, "externally
visible behavior change" is not limited to that. For example, it
could also means that the canister makes different requests to
other canisters.
0a76ec0
to
09b5850
Compare
ecb904e
to
4fbdbec
Compare
f98d938
to
7d01839
Compare
266b4b8
to
326720c
Compare
7d01839
to
0ad820f
Compare
420bc4b
to
329b618
Compare
TLA instrumentation changes LGTM, thanks! |
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.
LGTM.
329b618
to
3a7fd97
Compare
Why
Currently,
DisburseMaturity
supports disbursing into any icrc1 account. However, we still have valid use cases beyond icrc1 account, for example for disbursing into a CEX account, which typically does not use icrc1 account but a 32-byte account identifier.What
to_account_identifier
as a new field in theDisburseMaturity
command inputaccount_to_disbures_to
in the storage type into aoneof destination
with the previousaccount_to_disbures_to
as one variant.Destination::try_new
to handle the 3 cases - (a) no account or account identifier (use caller), (b) account, and (c) account identifierDestination
toAccountIdentifier
for the finalization (for minting ICPs).Destination
toOption<Account>
andOption<AccountIdentifier>
for the fields in "full neuron"Backward Compatibility
The main concern of the backward compatibility is that there can already be disbursements prior to this PR, and they do not use the
oneof destination
but the previous schema with onlyaccount_to_disbures_to
. Theoneof
is designed to be compatible with the previous schema, and thetest_deserialize_maturity_disbursement_from_old_format
test is added to make sure that the decoding actually works, at theStorable
level.