Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit b4b9763

Browse files
authored
stake-pool: Cleanup comments and rename functions (#2283)
1 parent 05325a5 commit b4b9763

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

stake-pool/program/src/processor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,7 @@ impl Processor {
22002200
let has_active_stake = validator_list
22012201
.find::<ValidatorStakeInfo>(
22022202
&0u64.to_le_bytes(),
2203-
ValidatorStakeInfo::memcmp_active_lamports,
2203+
ValidatorStakeInfo::active_lamports_not_equal,
22042204
)
22052205
.is_some();
22062206

@@ -2209,7 +2209,7 @@ impl Processor {
22092209
let has_transient_stake = validator_list
22102210
.find::<ValidatorStakeInfo>(
22112211
&0u64.to_le_bytes(),
2212-
ValidatorStakeInfo::memcmp_transient_lamports,
2212+
ValidatorStakeInfo::transient_lamports_not_equal,
22132213
)
22142214
.is_some();
22152215
if has_transient_stake || has_active_stake {

stake-pool/program/src/state.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ impl StakePool {
310310
Ok(())
311311
}
312312

313-
/// Check staker validity and signature
313+
/// Check mint is correct
314314
#[inline]
315315
pub(crate) fn check_mint(&self, mint_info: &AccountInfo) -> Result<(), ProgramError> {
316316
if *mint_info.key != self.pool_mint {
@@ -371,7 +371,7 @@ impl StakePool {
371371
}
372372
}
373373

374-
/// Check the validator list is valid
374+
/// Check the reserve stake is valid
375375
pub fn check_reserve_stake(
376376
&self,
377377
reserve_stake_info: &AccountInfo,
@@ -528,14 +528,14 @@ impl ValidatorStakeInfo {
528528
}
529529

530530
/// Performs a very cheap comparison, for checking if this validator stake
531-
/// info has active lamports equal to the given bytes
532-
pub fn memcmp_active_lamports(data: &[u8], lamports_le_bytes: &[u8]) -> bool {
531+
/// info does not have active lamports equal to the given bytes
532+
pub fn active_lamports_not_equal(data: &[u8], lamports_le_bytes: &[u8]) -> bool {
533533
sol_memcmp(&data[0..8], lamports_le_bytes, 8) != 0
534534
}
535535

536536
/// Performs a very cheap comparison, for checking if this validator stake
537-
/// info has lamports equal to the given bytes
538-
pub fn memcmp_transient_lamports(data: &[u8], lamports_le_bytes: &[u8]) -> bool {
537+
/// info does not have lamports equal to the given bytes
538+
pub fn transient_lamports_not_equal(data: &[u8], lamports_le_bytes: &[u8]) -> bool {
539539
sol_memcmp(&data[8..16], lamports_le_bytes, 8) != 0
540540
}
541541

0 commit comments

Comments
 (0)