Skip to content

Commit

Permalink
Fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Jul 10, 2023
1 parent 7b33e1c commit 189816d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions relay/runtimes/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,10 @@ fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() {

// should be [WithdrawAsset, BuyExecution, Transact, RefundSurplus, DepositAsset]
let blob = hex_literal::hex!("02140004000000000700e40b540213000000000700e40b54020006010700c817a804341801000006010b00c490bf4302140d010003ffffffff000100411f");
let Ok(VersionedXcm::V2(old_xcm)) =
VersionedXcm::<super::RuntimeCall>::decode(&mut &blob[..]) else { panic!("can't decode XCM blob") };
let Ok(VersionedXcm::V2(old_xcm)) = VersionedXcm::<super::RuntimeCall>::decode(&mut &blob[..])
else {
panic!("can't decode XCM blob")
};
let mut xcm: Xcm<super::RuntimeCall> =
old_xcm.try_into().expect("conversion from v2 to v3 failed");
let weight = <XcmConfig as xcm_executor::Config>::Weigher::weight(&mut xcm)
Expand All @@ -440,9 +442,10 @@ fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() {
assert!(weight.all_lte(Weight::from_parts(30_313_281_000, 65536)));

let Some(Transact { require_weight_at_most, call, .. }) =
xcm.inner_mut().into_iter().find(|inst| matches!(inst, Transact { .. })) else {
panic!("no Transact instruction found")
};
xcm.inner_mut().into_iter().find(|inst| matches!(inst, Transact { .. }))
else {
panic!("no Transact instruction found")
};
// should be pallet_utility.as_derivative { index: 0, call: pallet_staking::bond_extra { max_additional: 2490000000000 } }
let message_call = call.take_decoded().expect("can't decode Transact call");
let call_weight = message_call.get_dispatch_info().weight;
Expand Down

0 comments on commit 189816d

Please sign in to comment.