mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 06:47:57 +00:00
Add with_weight extrinsic (#12848)
* add with weight extrinsic * improve test
This commit is contained in:
@@ -901,3 +901,30 @@ fn batch_all_works_with_council_origin() {
|
||||
));
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn with_weight_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let upgrade_code_call =
|
||||
Box::new(RuntimeCall::System(frame_system::Call::set_code_without_checks {
|
||||
code: vec![],
|
||||
}));
|
||||
// Weight before is max.
|
||||
assert_eq!(upgrade_code_call.get_dispatch_info().weight, Weight::MAX);
|
||||
assert_eq!(
|
||||
upgrade_code_call.get_dispatch_info().class,
|
||||
frame_support::dispatch::DispatchClass::Operational
|
||||
);
|
||||
|
||||
let with_weight_call = Call::<Test>::with_weight {
|
||||
call: upgrade_code_call,
|
||||
weight: Weight::from_parts(123, 456),
|
||||
};
|
||||
// Weight after is set by Root.
|
||||
assert_eq!(with_weight_call.get_dispatch_info().weight, Weight::from_parts(123, 456));
|
||||
assert_eq!(
|
||||
with_weight_call.get_dispatch_info().class,
|
||||
frame_support::dispatch::DispatchClass::Operational
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user