From 3af64d374a4ecaa604e359cfd7010128949d06aa Mon Sep 17 00:00:00 2001 From: gui Date: Mon, 30 Dec 2024 20:20:09 +0900 Subject: [PATCH] fmt --- cumulus/pallets/weight-reclaim/src/lib.rs | 9 ++++++--- cumulus/pallets/weight-reclaim/src/tests.rs | 8 +++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cumulus/pallets/weight-reclaim/src/lib.rs b/cumulus/pallets/weight-reclaim/src/lib.rs index 4b6ac34bf5d9..14f6c86f4bd2 100644 --- a/cumulus/pallets/weight-reclaim/src/lib.rs +++ b/cumulus/pallets/weight-reclaim/src/lib.rs @@ -239,7 +239,8 @@ where let extrinsic_len = frame_system::AllExtrinsicsLen::::get().unwrap_or(0); let node_side_pov_size = proof_size_after_dispatch.saturating_add(extrinsic_len.into()); let block_weight_proof_size = current_weight.total().proof_size(); - let pov_size_missing_from_node = node_side_pov_size.saturating_sub(block_weight_proof_size); + let pov_size_missing_from_node = + node_side_pov_size.saturating_sub(block_weight_proof_size); if pov_size_missing_from_node > 0 { log::warn!( target: LOG_TARGET, @@ -248,7 +249,8 @@ where {block_weight_proof_size}, missing: {pov_size_missing_from_node}. Setting to \ node-side proof size." ); - current_weight.accrue(Weight::from_parts(0, pov_size_missing_from_node), info.class); + current_weight + .accrue(Weight::from_parts(0, pov_size_missing_from_node), info.class); } pov_size_missing_from_node @@ -257,7 +259,8 @@ where // The saturation will happen if the pre-dispatch weight is underestimating the proof // size or if the node-side proof size is higher than expected. // In this case the extrinsic proof size weight reclaimed is 0 and not a negative reclaim. - let accurate_unspent = info.total_weight() + let accurate_unspent = info + .total_weight() .saturating_sub(accurate_weight) .saturating_sub(Weight::from_parts(0, pov_size_missing_from_node)); frame_system::ExtrinsicWeightReclaimed::::put(accurate_unspent); diff --git a/cumulus/pallets/weight-reclaim/src/tests.rs b/cumulus/pallets/weight-reclaim/src/tests.rs index f94ce89dba61..abab9f64537a 100644 --- a/cumulus/pallets/weight-reclaim/src/tests.rs +++ b/cumulus/pallets/weight-reclaim/src/tests.rs @@ -931,10 +931,8 @@ fn test_pov_missing_from_node_reclaim() { let node_post_dispatch = node_pre_dispatch + node_diff; // Initialize the test. - let mut test_ext = setup_test_externalities(&[ - node_pre_dispatch as usize, - node_post_dispatch as usize, - ]); + let mut test_ext = + setup_test_externalities(&[node_pre_dispatch as usize, node_post_dispatch as usize]); test_ext.execute_with(|| { set_current_storage_weight(block_pre_dispatch); @@ -950,7 +948,7 @@ fn test_pov_missing_from_node_reclaim() { // Execute the transaction. let tx_ext = StorageWeightReclaim::>::new( - frame_system::CheckWeight::new() + frame_system::CheckWeight::new(), ); let (pre, _) = tx_ext .validate_and_prepare(ALICE_ORIGIN.clone().into(), CALL, &info, len as usize, 0)