-
Notifications
You must be signed in to change notification settings - Fork 32
[Replaced] tests: Mollusk Initialize tests (1/9) #161
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
Conversation
2ab4655 to
c2acd67
Compare
| pub struct StakeTestContext { | ||
| pub mollusk: Mollusk, | ||
| pub rent_exempt_reserve: u64, | ||
| pub staker: Pubkey, | ||
| pub withdrawer: Pubkey, | ||
| } |
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 is extended in next PR, when the instructions being tested require it
| pub fn create_uninitialized_account(self) -> AccountSharedData { | ||
| AccountSharedData::new_data_with_space( | ||
| STAKE_RENT_EXEMPTION, | ||
| &StakeStateV2::Uninitialized, | ||
| StakeStateV2::size_of(), | ||
| &id(), | ||
| ) | ||
| .unwrap() | ||
| } |
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.
Full lifecycle management is in next PR (Initialize tests don't need it)
| _ => &default_checks, | ||
| }; | ||
|
|
||
| let test_missing_signers = self.test_missing_signers.unwrap_or(true); |
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.
Assumed true, so tests must explicitly opt out with .test_missing_signers(false)
Meant to prevent a test from forgetting to test missing signers.
| @@ -0,0 +1,7 @@ | |||
| #![allow(clippy::arithmetic_side_effects)] | |||
| #![allow(dead_code)] | |||
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.
Since test banks compile individually, we'll soon otherwise get dead_code warnings for any helpers which are not used in every single one.
|
Taking back to draft pending a few small updates based on discussions in Rome |
ae6950e to
dc2862f
Compare
[Replaced]