From b321f9d72b4d5528ad0f8470c20974669892b7a3 Mon Sep 17 00:00:00 2001 From: skosito Date: Fri, 1 Nov 2024 00:26:19 +0100 Subject: [PATCH] fmt --- programs/protocol-contracts-solana/src/lib.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/programs/protocol-contracts-solana/src/lib.rs b/programs/protocol-contracts-solana/src/lib.rs index 7268dee..81302e0 100644 --- a/programs/protocol-contracts-solana/src/lib.rs +++ b/programs/protocol-contracts-solana/src/lib.rs @@ -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] { @@ -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(()) } @@ -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] { @@ -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, @@ -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, whitelist_candidate: &mut Account,