Skip to content

Commit 9034445

Browse files
committed
tweak comments
1 parent cdfb3d7 commit 9034445

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

program/tests/helpers/context.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,19 @@ use {
1212
};
1313

1414
/// Builder for creating stake accounts with customizable parameters
15-
/// Follows the builder pattern for flexibility and readability
1615
pub struct StakeAccountBuilder {
1716
lifecycle: StakeLifecycle,
1817
}
1918

2019
impl StakeAccountBuilder {
21-
/// Build the stake account and return (pubkey, account_data)
2220
pub fn build(self) -> (Pubkey, AccountSharedData) {
2321
let stake_pubkey = Pubkey::new_unique();
2422
let account = self.lifecycle.create_uninitialized_account();
2523
(stake_pubkey, account)
2624
}
2725
}
2826

29-
/// Consolidated test context that bundles all common test setup
30-
/// This eliminates boilerplate from every test
27+
/// Consolidated test context for stake account tests
3128
pub struct StakeTestContext {
3229
pub mollusk: Mollusk,
3330
pub rent_exempt_reserve: u64,
@@ -49,7 +46,6 @@ impl StakeTestContext {
4946
}
5047

5148
/// Create a stake account builder for the specified lifecycle stage
52-
/// This is the primary method for creating stake accounts in tests.
5349
///
5450
/// Example:
5551
/// ```
@@ -61,7 +57,7 @@ impl StakeTestContext {
6157
StakeAccountBuilder { lifecycle }
6258
}
6359

64-
/// Process an instruction with a config-based approach
60+
/// Process an instruction
6561
pub fn process_with<'b, C: InstructionConfig>(
6662
&self,
6763
config: C,
@@ -73,7 +69,7 @@ impl StakeTestContext {
7369
)
7470
}
7571

76-
/// Internal helper to process an instruction with optional missing signer testing
72+
/// Process an instruction with optional missing signer testing
7773
pub(crate) fn process_instruction_maybe_test_signers(
7874
&self,
7975
instruction: &Instruction,

program/tests/helpers/utils.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ pub fn add_sysvars(
5252
mollusk.sysvars.keyed_account_for_epoch_rewards_sysvar().1
5353
} else if StakeHistory::check_id(&key) {
5454
// Re-serialize stake history from mollusk.sysvars.stake_history
55-
// to ensure updates are reflected
5655
mollusk.sysvars.keyed_account_for_stake_history_sysvar().1
5756
} else {
5857
// Default empty account
59-
// Note: stake_config is not provided, so get_minimum_delegation() returns 1
6058
Account::default()
6159
};
6260

0 commit comments

Comments
 (0)