-
Notifications
You must be signed in to change notification settings - Fork 7
Introduce MintCustomizer
trait
#201
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
/// `MintCustomizer` trait definition | ||
pub mod interface; | ||
/// No extensions version of the mint | ||
pub mod no_extensions; |
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.
Upcoming PRs will add additional mint customizers here
e23bd28
to
e9adc74
Compare
e9adc74
to
c5a04d5
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.
Makes sense to me!
program/src/processor.rs
Outdated
} else { | ||
vec![] | ||
}; | ||
let space = ExtensionType::try_calculate_account_len::<Mint>(&extensions)?; |
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.
This works for now, but it'll need some extra logic for metadata in the future, since metadata has a variable length
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.
Ah! Instead of requesting a list of extensions, I'll swap the interface to return space instead 👍
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.
Based
This change refactors the
CreateMint
instruction processor to accept a genericMintCustomizer
trait. This allows developers to more easily fork the program and implement custom logic for creating the wrapped mint (specific extensions, freeze auth choice, etc).