Skip to content
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] Solana tests 2 #1255

Merged
merged 16 commits into from
Jan 30, 2024
Merged

[solana] Solana tests 2 #1255

merged 16 commits into from
Jan 30, 2024

Conversation

guibescos
Copy link
Contributor

@guibescos guibescos commented Jan 29, 2024

The goal of this PR is to expand the testing coverage to post_updates_atomic
For this we add a way to created signed VAAs to pythnet_sdk/test-utils . We also simulate the guardian set account in setup_pyth_receiver.

Copy link

vercel bot commented Jan 29, 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 30, 2024 0:43am
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Jan 30, 2024 0:43am

.iter()
.map(|x| libsecp256k1::sign(&digest, &x))
.collect();
let wormhole_signatures: Vec<wormhole_sdk::vaa::Signature> = signatures
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding actual signatures to the common sdk

@guibescos guibescos changed the title Solana tests 2 [solana] Solana tests 2 Jan 29, 2024
.github/workflows/ci-solana-contract.yml Show resolved Hide resolved
pythnet/pythnet_sdk/src/test_utils/mod.rs Show resolved Hide resolved

let digest = libsecp256k1Message::parse_slice(&body.digest().unwrap().secp256k_hash).unwrap();

let signatures: Vec<(Signature, RecoveryId)> = guardians[0..NUM_SIGNATURES]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the number of signatures should be an argument to the function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also do you want it to be the case that it's always the first N guardians who signed? are there possible tests where you want a random subset of guardians or something?

I would think about the range of configurability you need downstream and then try to build that in to the test methods here.

Another similar question would be whether you need the ability to define & work with different guardian sets in the tests. In that case, you may want to make the signing guardian keys an argument to this function.

Copy link
Contributor Author

@guibescos guibescos Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so I switched to having random subsets of guardians. I don't think I need more configurability for now.

@guibescos guibescos merged commit b0c6497 into main Jan 30, 2024
7 checks passed
@guibescos guibescos deleted the solana-tests-2 branch January 30, 2024 13:55
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.

2 participants