Skip to content

Commit

Permalink
address some CI complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Oct 2, 2024
1 parent b0318bb commit 0e18af4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions programs/protocol-contracts-solana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ pub mod gateway {
Ok(())
}

pub fn deposit(ctx: Context<Deposit>, amount: u64, receiver: [u8; 20]) -> Result<()> {
pub fn deposit(
ctx: Context<Deposit>,
amount: u64,
receiver: [u8; 20], // not used in this program; for directing zetachain protocol only
) -> Result<()> {
let pda = &mut ctx.accounts.pda;
require!(!pda.deposit_paused, Errors::DepositPaused);

Expand Down Expand Up @@ -114,13 +118,13 @@ pub mod gateway {
) -> Result<()> {
require!(message.len() <= 512, Errors::MemoLengthExceeded);
deposit(ctx, amount, receiver)?;
return Ok(());
Ok(())
}

pub fn deposit_spl_token(
ctx: Context<DepositSplToken>,
amount: u64,
receiver: [u8; 20],
receiver: [u8; 20], // unused in this program; for directing zetachain protocol only

Check warning on line 127 in programs/protocol-contracts-solana/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] programs/protocol-contracts-solana/src/lib.rs#L127

warning: unused variable: `receiver` --> programs/protocol-contracts-solana/src/lib.rs:127:9 | 127 | receiver: [u8; 20], // unused in this program; for directing zetachain protocol only | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_receiver` | = note: `#[warn(unused_variables)]` on by default
Raw output
programs/protocol-contracts-solana/src/lib.rs:127:9:w:warning: unused variable: `receiver`
   --> programs/protocol-contracts-solana/src/lib.rs:127:9
    |
127 |         receiver: [u8; 20], // unused in this program; for directing zetachain protocol only
    |         ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_receiver`
    |
    = note: `#[warn(unused_variables)]` on by default


__END__
) -> Result<()> {
let token = &ctx.accounts.token_program;
let from = &ctx.accounts.from;
Expand Down Expand Up @@ -161,7 +165,7 @@ pub mod gateway {
) -> Result<()> {
require!(message.len() <= 512, Errors::MemoLengthExceeded);
deposit_spl_token(ctx, amount, receiver)?;
return Ok(());
Ok(())
}

// require tss address signature on the internal message defined in the following
Expand Down

0 comments on commit 0e18af4

Please sign in to comment.