Rename Origin (#1628)

* Rename Origin

* more renaming

* fixes

* fix errors

* last fix?

* rename

* Update mock.rs

* update lockfile for {"polkadot", "substrate"}

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Sergej Sakac
2022-09-21 01:17:31 +02:00
committed by GitHub
parent 6f40bb9efe
commit 14186393b2
35 changed files with 488 additions and 458 deletions
+24 -9
View File
@@ -90,7 +90,7 @@ pub mod pallet {
type XcmExecutor: ExecuteXcm<Self::RuntimeCall>;
/// Origin which is allowed to execute overweight messages.
type ExecuteOverweightOrigin: EnsureOrigin<Self::Origin>;
type ExecuteOverweightOrigin: EnsureOrigin<Self::RuntimeOrigin>;
}
/// The configuration.
@@ -387,7 +387,7 @@ mod tests {
type AccountId = u64;
impl frame_system::Config for Test {
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = u64;
@@ -744,15 +744,23 @@ mod tests {
assert_eq!(overweights(), vec![0]);
assert_noop!(
DmpQueue::service_overweight(Origin::signed(1), 0, Weight::from_ref_time(20000)),
DmpQueue::service_overweight(
RuntimeOrigin::signed(1),
0,
Weight::from_ref_time(20000)
),
BadOrigin
);
assert_noop!(
DmpQueue::service_overweight(Origin::root(), 1, Weight::from_ref_time(20000)),
DmpQueue::service_overweight(
RuntimeOrigin::root(),
1,
Weight::from_ref_time(20000)
),
Error::<Test>::Unknown
);
assert_noop!(
DmpQueue::service_overweight(Origin::root(), 0, Weight::from_ref_time(9999)),
DmpQueue::service_overweight(RuntimeOrigin::root(), 0, Weight::from_ref_time(9999)),
Error::<Test>::OverLimit
);
assert_eq!(take_trace(), vec![msg_limit_reached(10000)]);
@@ -762,16 +770,23 @@ mod tests {
.get_dispatch_info()
.weight;
use frame_support::dispatch::GetDispatchInfo;
let info =
DmpQueue::service_overweight(Origin::root(), 0, Weight::from_ref_time(20000))
.unwrap();
let info = DmpQueue::service_overweight(
RuntimeOrigin::root(),
0,
Weight::from_ref_time(20000),
)
.unwrap();
let actual_weight = info.actual_weight.unwrap();
assert_eq!(actual_weight, base_weight + Weight::from_ref_time(10000));
assert_eq!(take_trace(), vec![msg_complete(10000)]);
assert!(overweights().is_empty());
assert_noop!(
DmpQueue::service_overweight(Origin::root(), 0, Weight::from_ref_time(20000)),
DmpQueue::service_overweight(
RuntimeOrigin::root(),
0,
Weight::from_ref_time(20000)
),
Error::<Test>::Unknown
);
});