Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Oct 31, 2024
1 parent 6ac239d commit b321f9d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions programs/protocol-contracts-solana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub mod gateway {
) -> Result<()> {
let pda = &mut ctx.accounts.pda;
let whitelist_candidate = &mut ctx.accounts.whitelist_candidate;
let authority = &ctx.accounts.authority;
let authority = &ctx.accounts.authority;

// signature provided, recover and verify that tss is the signer
if signature != [0u8; 64] {
Expand All @@ -115,15 +115,14 @@ pub mod gateway {
nonce,
"whitelist_spl_mint",
)?;
}
else {
} else {
// no signature provided, fallback to authority check
require!(
authority.key() == pda.authority,
Errors::SignerIsNotAuthority
);
}

Ok(())
}

Expand All @@ -139,7 +138,7 @@ pub mod gateway {
) -> Result<()> {
let pda = &mut ctx.accounts.pda;
let whitelist_candidate: &mut Account<'_, Mint> = &mut ctx.accounts.whitelist_candidate;
let authority = &ctx.accounts.authority;
let authority = &ctx.accounts.authority;

// signature provided, recover and verify that tss is the signer
if signature != [0u8; 64] {
Expand All @@ -152,8 +151,7 @@ pub mod gateway {
nonce,
"unwhitelist_spl_mint",
)?;
}
else {
} else {
// no signature provided, fallback to authority check
require!(
authority.key() == pda.authority,
Expand Down Expand Up @@ -458,7 +456,7 @@ fn recover_eth_address(
Ok(eth_address)
}

// recover and verify tss signature for whitelist and unwhitelist instructions
// recover and verify tss signature for whitelist and unwhitelist instructions
fn validate_whitelist_tss_signature(
pda: &mut Account<Pda>,
whitelist_candidate: &mut Account<Mint>,
Expand Down

0 comments on commit b321f9d

Please sign in to comment.