From dd9982320eee412e46c81cf95df37d7245f26adb Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Thu, 30 Jan 2025 00:55:11 +0400 Subject: [PATCH] cleanup --- pallets/rewards/src/functions/rewards.rs | 8 ++++---- pallets/rewards/src/mock.rs | 2 +- pallets/rewards/src/mock_evm.rs | 10 ++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pallets/rewards/src/functions/rewards.rs b/pallets/rewards/src/functions/rewards.rs index 44f82dd7e..4cb5bb455 100644 --- a/pallets/rewards/src/functions/rewards.rs +++ b/pallets/rewards/src/functions/rewards.rs @@ -178,7 +178,7 @@ impl Pallet { original_apy: Percent, ) -> Option { if deposit_cap.is_zero() { - return None + return None; } let propotion = Percent::from_rational(total_deposit, deposit_cap); @@ -195,7 +195,7 @@ impl Pallet { pub fn calculate_reward_per_block(total_reward: BalanceOf) -> Option> { let apy_blocks = ApyBlocks::::get(); if apy_blocks.is_zero() { - return None + return None; } log::debug!("calculate_reward_per_block : total_reward: {:?}", total_reward); @@ -214,7 +214,7 @@ impl Pallet { // If we haven't reached the decay period yet, no decay if blocks_since_last_claim <= start_period { - return Percent::from_percent(100) + return Percent::from_percent(100); } let decay_rate = DecayRate::::get(); @@ -260,7 +260,7 @@ impl Pallet { let deposit_cap = reward.deposit_cap; if reward.incentive_cap > total_deposit { - return Err(Error::::TotalDepositLessThanIncentiveCap.into()) + return Err(Error::::TotalDepositLessThanIncentiveCap.into()); } let apy = Self::calculate_propotional_apy(total_deposit, deposit_cap, reward.apy) diff --git a/pallets/rewards/src/mock.rs b/pallets/rewards/src/mock.rs index 9d53cf81d..8e887a6ef 100644 --- a/pallets/rewards/src/mock.rs +++ b/pallets/rewards/src/mock.rs @@ -273,7 +273,7 @@ impl tangle_primitives::traits::MultiAssetDelegationInfo bool { if operator == &mock_pub_key(10) { - return false + return false; } true } diff --git a/pallets/rewards/src/mock_evm.rs b/pallets/rewards/src/mock_evm.rs index 0a5e26860..93538421d 100644 --- a/pallets/rewards/src/mock_evm.rs +++ b/pallets/rewards/src/mock_evm.rs @@ -205,8 +205,9 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { len: usize, ) -> Option> { match self { - RuntimeCall::Ethereum(call) => - call.pre_dispatch_self_contained(info, dispatch_info, len), + RuntimeCall::Ethereum(call) => { + call.pre_dispatch_self_contained(info, dispatch_info, len) + }, _ => None, } } @@ -216,8 +217,9 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { info: Self::SignedInfo, ) -> Option>> { match self { - call @ RuntimeCall::Ethereum(pallet_ethereum::Call::transact { .. }) => - Some(call.dispatch(RuntimeOrigin::from(RawOrigin::EthereumTransaction(info)))), + call @ RuntimeCall::Ethereum(pallet_ethereum::Call::transact { .. }) => { + Some(call.dispatch(RuntimeOrigin::from(RawOrigin::EthereumTransaction(info)))) + }, _ => None, } }