-
Notifications
You must be signed in to change notification settings - Fork 308
[Solana] tests #1226
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
[Solana] tests #1226
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
| transaction::Transaction, | ||
| }, | ||
| }; | ||
|
|
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.
I dropped the logic to add a program as upgradable because it doesn't seem to work with 1.16.20, and I don't think we'll need this for the Solana Receiver
|
|
||
| impl crate::accounts::Initialize { | ||
| pub fn populate(payer: &Pubkey) -> Self { | ||
| let config = Pubkey::find_program_address(&[CONFIG_SEED.as_ref()], &crate::ID).0; |
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.
These get moved to sdk
jayantk
left a comment
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.
LGTM. I think you will need to refactor the test helper methods to be more flexible -- right now, they're not going to be very helpful for other tests -- but feel free to merge this and refactor as you go.
target_chains/solana/programs/pyth-solana-receiver/tests/common/mod.rs
Outdated
Show resolved
Hide resolved
target_chains/solana/programs/pyth-solana-receiver/tests/common/mod.rs
Outdated
Show resolved
Hide resolved
| * - The pubkey of an encoded VAA account, which is pre-populated and can be used to test post_updates | ||
| * - A vector of MerklePriceUpdate, corresponding to that VAA | ||
| */ | ||
| pub async fn setup_pyth_receiver() -> ProgramTestFixtures { |
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 seems like an odd combination of functionality. It seems like most tests will want to send their own set of price updates (?) Will this ever be reused?
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.
(it's a little annoying that you need to set up the encoded vaa accounts before the simulator gets created. Tests probably want the ability to modify the set of encoded VAA accounts themselves. Not sure if there's a good way to facilitate that though.
Even if you can't address that, passing in the set of accounts/merkle trees here would make this code more flexible)
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.
I'll think about this in future development
It's just a happy path for now, but this is a good time to review the fixtures and setup in general