Skip to content

Commit

Permalink
Style: format stable fmt
Browse files Browse the repository at this point in the history
* Fixed cargo +stable fmt check
  • Loading branch information
toints committed Oct 11, 2023
1 parent 7a8c8cf commit 94f8c29
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 9 additions & 6 deletions pallets/motion/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ fn setup_proposal(threshold: u32, motion_type: MotionType) -> Proposal {

// Setup motion with specified origin type
let motion = match motion_type {
MotionType::SimpleMajority =>
RuntimeCall::Motion(pallet_motion::Call::simple_majority { call: Box::new(inner_call) }),
MotionType::SuperMajority =>
RuntimeCall::Motion(pallet_motion::Call::super_majority { call: Box::new(inner_call) }),
MotionType::Unanimous =>
RuntimeCall::Motion(pallet_motion::Call::unanimous { call: Box::new(inner_call) }),
MotionType::SimpleMajority => {
RuntimeCall::Motion(pallet_motion::Call::simple_majority { call: Box::new(inner_call) })
},
MotionType::SuperMajority => {
RuntimeCall::Motion(pallet_motion::Call::super_majority { call: Box::new(inner_call) })
},
MotionType::Unanimous => {
RuntimeCall::Motion(pallet_motion::Call::unanimous { call: Box::new(inner_call) })
},
};

let proposal_len: u32 = motion.using_encoded(|p| p.len() as u32);
Expand Down
10 changes: 6 additions & 4 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall {
len: usize,
) -> Option<Result<(), TransactionValidityError>> {
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,
}
}
Expand All @@ -198,10 +199,11 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall {
info: Self::SignedInfo,
) -> Option<sp_runtime::DispatchResultWithInfo<PostDispatchInfoOf<Self>>> {
match self {
call @ RuntimeCall::Ethereum(pallet_ethereum::Call::transact { .. }) =>
call @ RuntimeCall::Ethereum(pallet_ethereum::Call::transact { .. }) => {
Some(call.dispatch(RuntimeOrigin::from(
pallet_ethereum::RawOrigin::EthereumTransaction(info),
))),
)))
},
_ => None,
}
}
Expand Down

0 comments on commit 94f8c29

Please sign in to comment.