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 more tests #219

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

solana: add more tests #219

wants to merge 7 commits into from

Conversation

kcsongor
Copy link
Contributor

No description provided.

Copy link
Collaborator

@johnsaigle johnsaigle left a comment

Choose a reason for hiding this comment

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

More tests are always great! Looks likes this needs a rebase.
After that I'll do a proper review. I'm sure adding tests will only be beneficial though so expect an approval

@kcsongor
Copy link
Contributor Author

kcsongor commented Mar 7, 2024

I'll rebase this later today

Copy link
Collaborator

@johnsaigle johnsaigle left a comment

Choose a reason for hiding this comment

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

Looks like this PR has some conflicts to be resolved

@kcsongor kcsongor force-pushed the solana-more-tests branch 4 times, most recently from fb22598 to 8abb41f Compare March 14, 2024 14:23
@kcsongor
Copy link
Contributor Author

@johnsaigle rebased!

@kcsongor kcsongor marked this pull request as ready for review March 14, 2024 14:23
@johnsaigle
Copy link
Collaborator

@kcsongor Clippy is unhappy

@kcsongor kcsongor force-pushed the solana-more-tests branch from 8abb41f to 71dcc38 Compare March 14, 2024 15:58
Copy link
Collaborator

@johnsaigle johnsaigle left a comment

Choose a reason for hiding this comment

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

EDIT: I committed this change directly to the branch.


CI is failing because of existing panic calls in programs/example-native-token-transfers/tests/common/setup.rs.

https://github.com/wormhole-foundation/example-native-token-transfers/blob/cb57ed240bc4e986a144c6bc7e6b7e6fb3823cb5/solana/programs/example-native-token-transfers/tests/common/setup.rs#L420-L425

I think this is somehow related to the rust-toolchain change? If I change to stable the panic is not flagged.

Anyway, I think you can add #[allow(clippy::panic)] just above the failing code block and it should resolve the issue

johnsaigle
johnsaigle previously approved these changes Mar 22, 2024
@johnsaigle
Copy link
Collaborator

@kcsongor A couple of notes:

  1. I added a commit to the branch: it adds a bad_mint_authority to the TestData object to resolve build failures. I'm not sure if this is the right approach so feel free to nuke that commit if it doesn't make sense to you.

  2. I'm very confused about the current test failure on test_receive(). It's getting an Ok(()) from release_inbound and so unwrap_err() panics. However, Ok(()) should never happen when we call try to release an inbox item twice (as it should be in ReleaseStatus::Released and therefore try_release() should throw an error).

Interestingly, the test actually passes if revert_on_delay is enabled (!)
I'm not sure how this is possible. Hopefully you have some insight to figure this one out.

(I opened #336 in the process of trying to debug this. Take a look, maybe it'll help you)

@nik-suri nik-suri added the solana Change to Solana programs label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 solana Change to Solana programs tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants