removal of contracts/ workspace experiment - clippy
This commit is contained in:
@@ -49,6 +49,7 @@ pub(crate) fn try_reward_node(
|
||||
|
||||
let absolute_epoch_id = interval.current_epoch_absolute_id();
|
||||
|
||||
#[allow(clippy::collapsible_if)]
|
||||
if let EpochState::Rewarding { last_rewarded, .. } = current_epoch_status.state {
|
||||
if last_rewarded >= node_id {
|
||||
return Err(MixnetContractError::NodeAlreadyRewarded {
|
||||
|
||||
@@ -1452,6 +1452,7 @@ pub mod test_helpers {
|
||||
|
||||
pub fn get_legacy_rewarding_node_work_factor(&self, node_id: NodeId) -> Decimal {
|
||||
let global_rewarding_params = self.rewarding_params();
|
||||
#[allow(clippy::let_and_return)]
|
||||
let work_factor =
|
||||
match expensive_role_lookup(self.deps.as_ref().storage, node_id).unwrap() {
|
||||
None => Decimal::zero(),
|
||||
|
||||
@@ -260,6 +260,7 @@ pub(crate) fn ensure_staking_permission(
|
||||
addr: &Addr,
|
||||
account: &Account,
|
||||
) -> Result<(), VestingContractError> {
|
||||
#[allow(clippy::collapsible_if)]
|
||||
if let Some(staking_address) = account.staking_address() {
|
||||
if staking_address == addr {
|
||||
return Ok(());
|
||||
|
||||
@@ -160,6 +160,7 @@ pub fn try_update_staking_address(
|
||||
deps: DepsMut<'_>,
|
||||
) -> Result<Response, VestingContractError> {
|
||||
if let Some(ref to_address) = to_address {
|
||||
#[allow(clippy::collapsible_if)]
|
||||
if account_from_address(to_address, deps.storage, deps.api).is_ok() {
|
||||
// do not allow setting staking address to an existing account's address
|
||||
return Err(VestingContractError::StakingAccountExists(
|
||||
|
||||
Reference in New Issue
Block a user