-
Notifications
You must be signed in to change notification settings - Fork 483
Fix/rewrite steel learning example #365
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
Fix/rewrite steel learning example #365
Conversation
|
@Perelyn-sama check this out |
|
I'll review later tonight, thanks for putting this together ❤️ |
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.
You don't need the state mod in this example, especially the Token type
Add the token fields in api::instruction::CreateToken like so:
pub struct CreateToken {
pub name: [u8; 32],
pub symbol: [u8; 8],
pub uri: [u8; 128],
pub decimals: u8,
}
since you're removing the state mod, you'd need get the metadata pda pubkey in api::sdk:: create_token function. This would work:
let metadata_pda = Pubkey::find_program_address(
&[METADATA, mpl_token_metadata::ID.as_ref(), mint.as_ref()],
&mpl_token_metadata::ID,
);
|
The rust code isn't formatted, you can fix that with You also need to add bankrun tests to get this merged here and there might be other things particular to this codebase you need to add so check the contributing guide |
|
@Perelyn-sama I've made the changes, please review. |
add checks for mint and metadata
|
LGTM |
Rewrote the entire learning example to align with the current Steel implementation.