Skip to content

Commit

Permalink
fix compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszaaa committed Mar 3, 2023
1 parent c309409 commit 1aacf46
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
50 changes: 25 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions pallets/parachain-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2618,7 +2618,7 @@ pub mod pallet {
collator: T::AccountId,
delegator_count: u32,
) -> DispatchResultWithPostInfo {
let caller = ensure_signed(origin)?;
let _caller = ensure_signed(origin)?;

let collator_payout_info = RoundCollatorRewardInfo::<T>::get(round, collator.clone())
.ok_or(Error::<T>::CollatorRoundRewardsDNE)?;
Expand Down Expand Up @@ -2654,13 +2654,13 @@ pub mod pallet {
collator: T::AccountId,
delegator: T::AccountId,
) -> DispatchResultWithPostInfo {
let caller = ensure_signed(origin)?;
let _caller = ensure_signed(origin)?;

RoundCollatorRewardInfo::<T>::try_mutate(
round,
collator,
|maybe_collator_payout_info| -> DispatchResult {
let mut collator_payout_info = maybe_collator_payout_info
let collator_payout_info = maybe_collator_payout_info
.as_mut()
.ok_or(Error::<T>::CollatorRoundRewardsDNE)?;
let delegator_reward = collator_payout_info
Expand Down Expand Up @@ -2773,7 +2773,7 @@ pub mod pallet {
AggregatorMetadata::<T>::try_mutate(
detached_aggregator.clone(),
|maybe_aggregator_metadata| -> DispatchResult {
let mut aggregator_metadata = maybe_aggregator_metadata
let aggregator_metadata = maybe_aggregator_metadata
.as_mut()
.ok_or(Error::<T>::AggregatorDNE)?;
let candidate_state =
Expand Down Expand Up @@ -2805,7 +2805,7 @@ pub mod pallet {
AggregatorMetadata::<T>::try_mutate(
new_aggregator,
|maybe_aggregator_metadata| -> DispatchResult {
let mut aggregator_metadata = maybe_aggregator_metadata
let aggregator_metadata = maybe_aggregator_metadata
.as_mut()
.ok_or(Error::<T>::AggregatorDNE)?;
ensure!(
Expand Down Expand Up @@ -2841,7 +2841,7 @@ pub mod pallet {
AggregatorMetadata::<T>::try_mutate(
prev_aggregator.clone(),
|maybe_prev_aggregator_metadata| -> DispatchResult {
let mut prev_aggregator_metadata = maybe_prev_aggregator_metadata
let prev_aggregator_metadata = maybe_prev_aggregator_metadata
.as_mut()
.ok_or(Error::<T>::AggregatorDNE)?;
let candidate_state =
Expand Down Expand Up @@ -3026,7 +3026,7 @@ pub mod pallet {

fn process_aggregator_with_rewards_and_dist(
round_to_payout: u32,
aggregator: T::AccountId,
_aggregator: T::AccountId,
author_rewards: Balance,
distribution: &BTreeMap<T::AccountId, Balance>,
) {
Expand Down Expand Up @@ -3124,7 +3124,7 @@ pub mod pallet {
})
.fold(
BTreeMap::<T::AccountId, Balance>::new(),
|mut acc, (bond, valuation, aggregator)| {
|mut acc, (_bond, valuation, aggregator)| {
acc.entry(aggregator.clone())
.and_modify(|total| *total = total.saturating_add(valuation))
.or_insert_with(|| valuation);
Expand Down
2 changes: 1 addition & 1 deletion pallets/parachain-staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ pub(crate) fn payout_collator_for_round(n: u64) {
n.try_into().unwrap(),
collator.clone(),
<Test as stake::Config>::MaxDelegatorsPerCandidate::get(),
);
).unwrap();
}
}

Expand Down
4 changes: 2 additions & 2 deletions pallets/parachain-staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! 4. Miscellaneous Property-Based Tests

use crate::mock::{
events, last_event, payout_collator_for_round, roll_to, set_author, ExtBuilder,
payout_collator_for_round, roll_to, set_author, ExtBuilder,
RuntimeEvent as MetaEvent, RuntimeOrigin as Origin, Stake, StakeCurrency, Test,
};

Expand All @@ -37,7 +37,7 @@ use frame_support::traits::tokens::currency::MultiTokenCurrency;
use frame_support::{assert_noop, assert_ok};
use orml_tokens::MultiTokenReservableCurrency;
use sp_runtime::{traits::Zero, DispatchError, ModuleError, Perbill};
use std::convert::TryFrom;


// ~~ ROOT ~~

Expand Down

0 comments on commit 1aacf46

Please sign in to comment.