Skip to content

Commit 68217e1

Browse files
authored
use proper error for ixn (#25)
1 parent e3f9f20 commit 68217e1

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

program/src/processor.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ use {
2424
std::{collections::HashSet, mem::MaybeUninit},
2525
};
2626

27-
// TODO a nice change would be to pop an account off the queue and discard if
28-
// its a gettable sysvar ie, allow people to omit them from the accounts list
29-
// without breaking compat to be done after release, we keep the existing
30-
// interface for all instructions for compat with firedancer
31-
32-
// TODO undecided if we do it in initial release or in a future release...
33-
// but we could use StakeError much more extensively and impl PrintProgramError
34-
3527
fn get_vote_state(vote_account_info: &AccountInfo) -> Result<Box<VoteState>, ProgramError> {
3628
if *vote_account_info.owner != solana_vote_program::id() {
3729
return Err(ProgramError::IncorrectProgramId);
@@ -1224,7 +1216,7 @@ impl Processor {
12241216
.unwrap_or(false);
12251217

12261218
let instruction =
1227-
bincode::deserialize(data).map_err(|_| ProgramError::InvalidAccountData)?;
1219+
bincode::deserialize(data).map_err(|_| ProgramError::InvalidInstructionData)?;
12281220

12291221
if epoch_rewards_active && !matches!(instruction, StakeInstruction::GetMinimumDelegation) {
12301222
return Err(StakeError::EpochRewardsActive.into());

0 commit comments

Comments
 (0)