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] Add wrong vaa tests #1262

Merged
merged 15 commits into from
Jan 31, 2024
Merged

[solana] Add wrong vaa tests #1262

merged 15 commits into from
Jan 31, 2024

Conversation

guibescos
Copy link
Contributor

@guibescos guibescos commented Jan 30, 2024

I'm trying to exhaustively test all errors that the receiver can throw. This covers 12 errors of the 21.

Copy link

vercel bot commented Jan 30, 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 31, 2024 1:50pm
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2024 1:50pm

@@ -2,16 +2,9 @@ use anchor_lang::prelude::*;

#[error_code]
pub enum ReceiverError {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reordered the errors to match the order of the tests

@@ -143,7 +143,7 @@ pub mod pyth_solana_receiver {
// We do not allow for non-increasing guardian signature indices.
let index = usize::from(sig.guardian_index());
if let Some(last_index) = last_guardian_index {
require!(index > last_index, ReceiverError::InvalidGuardianIndex);
require!(index > last_index, ReceiverError::InvalidGuardianOrder);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing this error because the same error code was used in another location

@guibescos guibescos changed the title Tests wrong [solana] Add tests Jan 30, 2024
@guibescos guibescos changed the title [solana] Add tests [solana] Add wrong vaa tests Jan 30, 2024
@guibescos guibescos marked this pull request as ready for review January 30, 2024 15:31
@guibescos guibescos merged commit 2ab72d9 into main Jan 31, 2024
5 checks passed
@guibescos guibescos deleted the tests-wrong branch January 31, 2024 14:16
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