Skip to content

Commit 04ff968

Browse files
authored
Update README.md
1 parent 632663c commit 04ff968

File tree

1 file changed

+7
-5
lines changed
  • not-so-smart-contracts/solana/signer_check

1 file changed

+7
-5
lines changed

not-so-smart-contracts/solana/signer_check/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ fn complete_escrow(_program_id: &Pubkey, accounts: &[AccountInfo], _instruction_
1616

1717
let mut state = State::deserialize(&mut &**state_info.data.borrow())?;
1818

19-
if &state.authority == authority.key {
20-
state.escrow_state = EscrowState::Complete;
21-
state.serialize(&mut &mut **state_info.data.borrow_mut())?;
22-
return Ok(());
19+
if state.authority != *authority.key {
20+
return Err(ProgramError::IncorrectAuthority);
2321
}
24-
Err(ProgramError::IncorrectAuthority)
22+
23+
state.escrow_state = EscrowState::Complete;
24+
state.serialize(&mut &mut **state_info.data.borrow_mut())?;
25+
26+
Ok(())
2527

2628
}
2729
```

0 commit comments

Comments
 (0)