Skip to content

Commit

Permalink
extend mismatch nonce msg
Browse files Browse the repository at this point in the history
Signed-off-by: skosito <[email protected]>
  • Loading branch information
skosito committed Jan 13, 2025
1 parent 14d228c commit 6de0b61
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions programs/gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,11 @@ pub mod gateway {
let pda = &mut ctx.accounts.pda;

if nonce != pda.nonce {
msg!("mismatch nonce");
msg!(
"Mismatch nonce: provided nonce = {}, expected nonce = {}",
nonce,
pda.nonce,
);
return err!(Errors::NonceMismatch);
}

Expand Down Expand Up @@ -421,9 +425,12 @@ pub mod gateway {
nonce: u64,
) -> Result<()> {
let pda = &mut ctx.accounts.pda;
// let program_id = &mut ctx.accounts
if nonce != pda.nonce {
msg!("mismatch nonce");
msg!(
"Mismatch nonce: provided nonce = {}, expected nonce = {}",
nonce,
pda.nonce,
);
return err!(Errors::NonceMismatch);
}

Expand Down Expand Up @@ -577,7 +584,11 @@ fn validate_whitelist_tss_signature(
instruction_name: &str,
) -> Result<()> {
if nonce != pda.nonce {
msg!("mismatch nonce");
msg!(
"Mismatch nonce: provided nonce = {}, expected nonce = {}",
nonce,
pda.nonce,
);
return err!(Errors::NonceMismatch);
}

Expand Down

0 comments on commit 6de0b61

Please sign in to comment.