Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-neon committed Jun 4, 2024
1 parent a489d26 commit 092da29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions counter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub fn process_instruction(
instruction_data: &[u8],
) -> ProgramResult {
let (instruction_discriminant, instruction_data_inner) = instruction_data.split_at(1);
set_return_data(instruction_discriminant);
match instruction_discriminant[0] {
1 => {
msg!("Instruction: Increment");
Expand Down Expand Up @@ -55,7 +54,7 @@ pub fn process_increment_counter(
let mut counter = Counter::try_from_slice(&counter_account.try_borrow_mut_data()?)?;
counter.count += 1;
counter.serialize(&mut *counter_account.data.borrow_mut())?;

set_return_data(&counter.count.to_le_bytes());
msg!("Counter state incremented to {:?}", counter.count);
Ok(())
}

0 comments on commit 092da29

Please sign in to comment.