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

Commit 1382629

Browse files
authored
Stake pool: test coverage for most of the program errors (#1134)
* Stake pool: test coverage for most of the program errors * Fixes to stake pool tests PR comments
1 parent 682e914 commit 1382629

File tree

12 files changed

+3247
-51
lines changed

12 files changed

+3247
-51
lines changed

stake-pool/program/src/processor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ impl Processor {
509509
}
510510

511511
if stake_pool.token_program_id != *token_program_info.key {
512-
return Err(StakePoolError::InvalidProgramAddress.into());
512+
return Err(ProgramError::IncorrectProgramId);
513513
}
514514
if stake_pool.pool_mint != *pool_mint_info.key {
515515
return Err(StakePoolError::WrongPoolMint.into());
@@ -637,7 +637,7 @@ impl Processor {
637637
}
638638

639639
if stake_pool.token_program_id != *token_program_info.key {
640-
return Err(StakePoolError::InvalidProgramAddress.into());
640+
return Err(ProgramError::IncorrectProgramId);
641641
}
642642
if stake_pool.pool_mint != *pool_mint_info.key {
643643
return Err(StakePoolError::WrongPoolMint.into());
@@ -855,7 +855,7 @@ impl Processor {
855855
return Err(StakePoolError::InvalidFeeAccount.into());
856856
}
857857
if stake_pool.token_program_id != *token_program_info.key {
858-
return Err(StakePoolError::InvalidProgramAddress.into());
858+
return Err(ProgramError::IncorrectProgramId);
859859
}
860860

861861
// Check validator stake account list storage
@@ -1004,7 +1004,7 @@ impl Processor {
10041004
stake_pool.check_authority_withdraw(withdraw_info.key, program_id, stake_pool_info.key)?;
10051005

10061006
if stake_pool.token_program_id != *token_program_info.key {
1007-
return Err(StakePoolError::InvalidProgramAddress.into());
1007+
return Err(ProgramError::IncorrectProgramId);
10081008
}
10091009

10101010
// Check validator stake account list storage

0 commit comments

Comments
 (0)