mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 17:07:56 +00:00
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:
@@ -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
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user