From 4c4df2256161216369d257c89b7984db63faa546 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Tue, 24 Sep 2024 15:10:02 +0800 Subject: [PATCH] Format Signed-off-by: Xavier Lau --- pallet/staking/src/lib.rs | 3 ++- pallet/staking/src/mock.rs | 6 ++++-- runtime/crab/src/migration.rs | 2 +- runtime/darwinia/src/migration.rs | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pallet/staking/src/lib.rs b/pallet/staking/src/lib.rs index 787126454..9bc28850b 100644 --- a/pallet/staking/src/lib.rs +++ b/pallet/staking/src/lib.rs @@ -816,7 +816,8 @@ pub mod pallet { // let cs_from_contract = Self::elect_from_contract(n1)?; // let cs_from_pallet = Self::elect(n2)?; let cs_from_contract = Self::elect_from_contract(n1).unwrap_or_default(); - let cs_from_pallet = Self::elect(n2).unwrap_or_default() + let cs_from_pallet = Self::elect(n2) + .unwrap_or_default() .into_iter() .filter(|c| !cs_from_contract.contains(c)) .collect(); diff --git a/pallet/staking/src/mock.rs b/pallet/staking/src/mock.rs index 3b45cc024..8f788f7b4 100644 --- a/pallet/staking/src/mock.rs +++ b/pallet/staking/src/mock.rs @@ -269,8 +269,10 @@ impl crate::Election for RingStaking { if Session::set_keys( RuntimeOrigin::signed(who), SessionKeys { uint: i.into() }, - Vec::new() - ).is_ok() { + Vec::new(), + ) + .is_ok() + { who } else { AccountId(0) diff --git a/runtime/crab/src/migration.rs b/runtime/crab/src/migration.rs index 0b5a24dae..75e85b19b 100644 --- a/runtime/crab/src/migration.rs +++ b/runtime/crab/src/migration.rs @@ -84,7 +84,7 @@ fn migrate() -> frame_support::weights::Weight { >::put(who); } - darwinia_staking::MigrationStartPoint::put(darwinia_staking::now()); + >::put(darwinia_staking::now::()); // frame_support::weights::Weight::zero() ::DbWeight::get().reads_writes(7, 7) diff --git a/runtime/darwinia/src/migration.rs b/runtime/darwinia/src/migration.rs index 602c900c1..cd8108886 100644 --- a/runtime/darwinia/src/migration.rs +++ b/runtime/darwinia/src/migration.rs @@ -92,7 +92,7 @@ fn migrate() -> frame_support::weights::Weight { >::put(who); } - darwinia_staking::MigrationStartPoint::put(darwinia_staking::now()); + >::put(darwinia_staking::now::()); // frame_support::weights::Weight::zero() ::DbWeight::get().reads_writes(7, 107)