Skip to content

Commit

Permalink
More PR comment cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jun 27, 2023
1 parent 256dc68 commit c2c02be
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions contracts/provider/external-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl ExternalStakingContract<'_> {
#[cfg(not(test))]
{
let _ = (ctx, validator, rewards);
panic!("This message is only available in test mode");
Err(ContractError::Unauthorized)
}
}

Expand Down Expand Up @@ -594,6 +594,7 @@ impl ExternalStakingContract<'_> {

let amount = Self::calculate_reward(stake, &distribution)?;

#[allow(unused_mut)]
#[allow(clippy::needless_borrow)]
let mut resp = Response::new()
.add_attribute("action", "withdraw_rewards")
Expand Down Expand Up @@ -623,23 +624,14 @@ impl ExternalStakingContract<'_> {
validator,
};

// TODO: error on None (use load) once we have better test setup
let channel_id = IBC_CHANNEL
.may_load(ctx.deps.storage)?
.map(|ch| ch.endpoint.channel_id)
.unwrap_or_else(|| "channel-72".to_string());
let channel_id = IBC_CHANNEL.load(ctx.deps.storage)?.endpoint.channel_id;
let send_msg = IbcMsg::SendPacket {
channel_id,
data: to_binary(&packet)?,
timeout: packet_timeout(&ctx.env),
};
resp = resp.add_message(send_msg);
}
#[cfg(test)]
{
// just to avoid clippy complaint about mut above
resp = resp.add_attribute("test", "test");
}
}

Ok(resp)
Expand Down

0 comments on commit c2c02be

Please sign in to comment.