-
Notifications
You must be signed in to change notification settings - Fork 6
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
Added test program crates for token and memo #35
base: main
Are you sure you want to change the base?
Conversation
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.
Nice! This will definitely make testing with these programs easier.
Just a bunch of nits from my side to get this in and published.
#[cfg(feature = "associated-token")] | ||
pub mod associated_token; | ||
// Last updated at mainnet-beta slot height: 298486032 |
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.
nit: can we move this to the top as a crate/module doc? ie:
#[cfg(feature = "associated-token")] | |
pub mod associated_token; | |
// Last updated at mainnet-beta slot height: 298486032 | |
//! Last updated at mainnet-beta slot height: 298486032 | |
#[cfg(feature = "associated-token")] | |
pub mod associated_token; |
// Last updated at mainnet-beta slot height: 298485997 | ||
#[cfg(feature = "memo")] | ||
pub mod memo; |
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.
Same here on the doc type please.
// Last updated at mainnet-beta slot height: 298485997 | |
#[cfg(feature = "memo")] | |
pub mod memo; | |
//! Last updated at mainnet-beta slot height: 298485997 | |
#[cfg(feature = "memo")] | |
pub mod memo; |
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.
Also will have to just adjust the scripts a bit.
solana program dump TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA ./src/elf/token.so -u mainnet-beta | ||
solana program dump TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb ./src/elf/token_2022.so -u mainnet-beta | ||
solana program dump ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL ./src/elf/associated_token.so -u mainnet-beta | ||
solana slot -u mainnet-beta | xargs -I {} sed -i '' 's|// Last updated at mainnet-beta slot height: .*|// Last updated at mainnet-beta slot height: {}|' ./src/lib.rs |
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.
heh, nice!
@@ -0,0 +1,15 @@ | |||
[package] | |||
name = "mollusk-memo" |
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.
name = "mollusk-memo" | |
name = "mollusk-svm-programs-memo" |
pub fn add_program(mollusk: &mut Mollusk) { | ||
mollusk.add_program_with_elf_and_loader( | ||
&ID, | ||
include_bytes!("elf/memo.so"), |
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 macro adds a static slice, so we could optionally just make this a constant in the module, since it might be a little funky for devs trying to access the ELF again through the target/debug
folder.
mollusk_svm::program::create_program_account_loader_v3(&ID) | ||
} | ||
|
||
/// Get the key and account for the system program. |
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.
/// Get the key and account for the system program. | |
/// Get the key and account for the SPL Token-2022 program. |
pub fn keyed_account() -> (Pubkey, AccountSharedData) { | ||
( | ||
ID, | ||
mollusk_svm::program::create_program_account_loader_v3(&ID), |
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 is the only module where you don't offer an account()
helper. Can we include it?
pub fn keyed_account() -> (Pubkey, AccountSharedData) { | ||
( | ||
ID, | ||
mollusk_svm::program::create_program_account_loader_v3(&ID), |
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.
Actually looks like this one doesn't have account()
either.
Co-authored-by: Joe C <[email protected]>
Co-authored-by: Joe C <[email protected]>
No description provided.