Skip to content

Conversation

@guibescos
Copy link
Contributor

@guibescos guibescos commented Jan 12, 2024

It's just a happy path for now, but this is a good time to review the fixtures and setup in general

@vercel
Copy link

vercel bot commented Jan 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Visit Preview Jan 17, 2024 3:46pm
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Jan 17, 2024 3:46pm

@guibescos guibescos changed the title Solana/tests 2 [Solana] tests Jan 12, 2024
transaction::Transaction,
},
};

Copy link
Contributor Author

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;
Copy link
Contributor Author

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

@guibescos guibescos marked this pull request as ready for review January 15, 2024 17:09
Copy link
Contributor

@jayantk jayantk left a 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.

* - 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 {
Copy link
Contributor

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?

Copy link
Contributor

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)

Copy link
Contributor Author

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

@guibescos guibescos merged commit d3ed683 into main Jan 17, 2024
@guibescos guibescos deleted the solana/tests-2 branch January 17, 2024 15:46
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