diff --git a/substrate-node/pallets/pallet-dao/src/dao.rs b/substrate-node/pallets/pallet-dao/src/dao.rs index 88c09b12c..bd53206a6 100644 --- a/substrate-node/pallets/pallet-dao/src/dao.rs +++ b/substrate-node/pallets/pallet-dao/src/dao.rs @@ -282,7 +282,7 @@ impl Pallet { result: result.map(|_| ()).map_err(|e| e.error), }); // default to the dispatch info weight for safety - let proposal_weight = get_result_weight(result).unwrap_or(dispatch_weight); // P1 + let proposal_weight = Self::get_result_weight(result).unwrap_or(dispatch_weight); // P1 Self::remove_proposal(proposal_hash); proposal_weight @@ -313,15 +313,15 @@ impl Pallet { Ok(().into()) } -} -/// Return the weight of a dispatch call result as an `Option`. -/// -/// Will return the weight regardless of what the state of the result is. -fn get_result_weight(result: DispatchResultWithPostInfo) -> Option { - match result { - Ok(post_info) => post_info.actual_weight, - Err(err) => err.post_info.actual_weight, + /// Return the weight of a dispatch call result as an `Option`. + /// + /// Will return the weight regardless of what the state of the result is. + fn get_result_weight(result: DispatchResultWithPostInfo) -> Option { + match result { + Ok(post_info) => post_info.actual_weight, + Err(err) => err.post_info.actual_weight, + } } } diff --git a/substrate-node/pallets/pallet-dao/src/lib.rs b/substrate-node/pallets/pallet-dao/src/lib.rs index 9518c3d35..f41db9d6d 100644 --- a/substrate-node/pallets/pallet-dao/src/lib.rs +++ b/substrate-node/pallets/pallet-dao/src/lib.rs @@ -8,7 +8,8 @@ use frame_support::{ dispatch::{ DispatchResult, DispatchResultWithPostInfo, Dispatchable, GetDispatchInfo, PostDispatchInfo, }, - traits::{EnsureOrigin, Get}}; + traits::{EnsureOrigin, Get}, +}; use tfchain_support::traits::{ChangeNode, Tfgrid}; pub use pallet::*;