Skip to content

Conversation

@rustopian
Copy link
Contributor

@rustopian rustopian commented Nov 4, 2025

[Replaced]

Comment on lines +28 to +33
pub struct StakeTestContext {
pub mollusk: Mollusk,
pub rent_exempt_reserve: u64,
pub staker: Pubkey,
pub withdrawer: Pubkey,
}
Copy link
Contributor Author

@rustopian rustopian Nov 4, 2025

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

Comment on lines 20 to 28
pub fn create_uninitialized_account(self) -> AccountSharedData {
AccountSharedData::new_data_with_space(
STAKE_RENT_EXEMPTION,
&StakeStateV2::Uninitialized,
StakeStateV2::size_of(),
&id(),
)
.unwrap()
}
Copy link
Contributor Author

@rustopian rustopian Nov 4, 2025

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

@rustopian rustopian Nov 4, 2025

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.

@rustopian rustopian marked this pull request as ready for review November 4, 2025 13:01
@@ -0,0 +1,7 @@
#![allow(clippy::arithmetic_side_effects)]
#![allow(dead_code)]
Copy link
Contributor Author

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.

@rustopian
Copy link
Contributor Author

rustopian commented Nov 13, 2025

Taking back to draft pending a few small updates based on discussions in Rome

@rustopian rustopian marked this pull request as draft November 13, 2025 20:18
@rustopian rustopian changed the title Mollusk 1/9: InstructionConfig, Initialize tests tests: Mollusk InstructionConfig, Initialize tests (1/9) Nov 14, 2025
@rustopian rustopian force-pushed the mollusk-1-initialize branch from ae6950e to dc2862f Compare December 9, 2025 10:50
@rustopian rustopian changed the title tests: Mollusk InstructionConfig, Initialize tests (1/9) tests: Mollusk Initialize tests (1/9) Dec 9, 2025
@rustopian rustopian closed this Dec 17, 2025
@rustopian rustopian changed the title tests: Mollusk Initialize tests (1/9) [Replaced] tests: Mollusk Initialize tests (1/9) Dec 17, 2025
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.

1 participant