-
Notifications
You must be signed in to change notification settings - Fork 2.3k
token-2022: prevent an already configured confidential account to be configured again #3216
token-2022: prevent an already configured confidential account to be configured again #3216
Conversation
179cfcc
to
5be8bfa
Compare
Added the I ended up just dividing the logic in |
One alternative to having a boolean flag |
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.
Looks good to me, but let's see what @CriesofCarrots thinks too, since I think we used to have init
and get
separated, but there was a good reason to unify them.
token/program-2022/src/extension/confidential_transfer/processor.rs
Outdated
Show resolved
Hide resolved
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, I can't remember any specific reason for the old api.
I do find the bool a little unintuitive to read, but I don't want 2 different functions, and can't really think of a reasonable alternative, so let's go with it
Great! Thanks for the review. |
The
confidential_transfer::ConfigureAccount
, should fail if run on an already configured account as stated in the description. However, this is currently not enforced in the processor logic, allowing users to overwrite the account state.This PR adds a check in the
ConfigureAccount
processor logic to prevent accounts from being configured again.Thank you @joncinque for the catch!