Skip to content

Conversation

@ubadineke
Copy link
Contributor

Rewrote the entire learning example to align with the current Steel implementation.

  • Refactored for clarity and correctness
  • Verified implementation with working code and tests

@ubadineke
Copy link
Contributor Author

@Perelyn-sama check this out

@Perelyn-sama
Copy link
Collaborator

I'll review later tonight, thanks for putting this together ❤️

Copy link
Collaborator

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,
    );

@Perelyn-sama
Copy link
Collaborator

The rust code isn't formatted, you can fix that with cargo fmt.

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

@ubadineke
Copy link
Contributor Author

@Perelyn-sama I've made the changes, please review.

@Perelyn-sama
Copy link
Collaborator

LGTM

cc @jacobcreech @heyAyushh

@jacobcreech jacobcreech merged commit 5364129 into solana-developers:main Apr 3, 2025
12 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants