-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
token 2022: make IncorrectMintAuthority
a TokenError
#5596
token 2022: make IncorrectMintAuthority
a TokenError
#5596
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
58ac7c2
to
da87e3e
Compare
2776f2e
to
82f3418
Compare
da87e3e
to
7e44111
Compare
82f3418
to
31ee52e
Compare
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.
Can we instead switch to the current TokenError::OwnerMismatch
instead of adding a new error?
Wouldn't that be confusing to some people since the mint authority is a separate thing from the owner? |
It's true that If we want to maintain ABI compatibility in Token-2022, it must return the same errors as tokenkeg for things like mint, freeze, and owner. We can make a new error for the other authorities though, and potentially use that new error in instructions that aren't present in tokenkeg. That seems like it'll be needlessly brittle and prone to error though. We can also decide to break ABI compatibility, but it seems like a lot of work just to fix error text. We could also change the name So to me, since we don't have a great alternative, I prefer to stick with what we have in |
No, we definitely don't want to break ABI compatibility or rename the enum variant.
This was what I was going for - particularly for SPL Token Metadata. However, if on the Tokenkeg/Token2022 side of things we're throwing
Yeah, that sounds like the best move here. I'll update the changes. |
Going to submit a new PR for the above and close this one. |
7e44111
to
85939c3
Compare
85939c3
to
f103552
Compare
This PR makes
IncorrectMintAuthority
aTokenError
, rather than aTokenMetadataError
, since it will likely be used across multiple extension processors (such as SPL Token Group).