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
@@ -182,7 +182,7 @@ impl frame_system::Config for Runtime {
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type.
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
type BlockHashCount = BlockHashCount;
/// Runtime version.
@@ -279,7 +279,7 @@ impl cumulus_pallet_aura_ext::Config for Runtime {}
parameter_types! {
pub const RocLocation: MultiLocation = MultiLocation::parent();
pub const RococoNetwork: NetworkId = NetworkId::Polkadot;
pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();
pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
}
@@ -341,21 +341,21 @@ pub type XcmOriginToTransactDispatchOrigin = (
// Sovereign account converter; this attempts to derive an `AccountId` from the origin location
// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
// foreign chains who want to have a local sovereign account on this chain which they control.
SovereignSignedViaLocation<LocationToAccountId, Origin>,
SovereignSignedViaLocation<LocationToAccountId, RuntimeOrigin>,
// Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when
// recognised.
RelayChainAsNative<RelayChainOrigin, Origin>,
RelayChainAsNative<RelayChainOrigin, RuntimeOrigin>,
// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
// recognised.
SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,
SiblingParachainAsNative<cumulus_pallet_xcm::Origin, RuntimeOrigin>,
// Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a
// transaction from the Root origin.
ParentAsSuperuser<Origin>,
ParentAsSuperuser<RuntimeOrigin>,
// Native signed account converter; this just converts an `AccountId32` origin into a normal
// `Origin::Signed` origin of the same 32-byte value.
SignedAccountId32AsNative<RococoNetwork, Origin>,
// `RuntimeOrigin::Signed` origin of the same 32-byte value.
SignedAccountId32AsNative<RococoNetwork, RuntimeOrigin>,
// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
XcmPassthrough<Origin>,
XcmPassthrough<RuntimeOrigin>,
);
parameter_types! {
@@ -418,7 +418,7 @@ impl Config for XcmConfig {
}
/// Local origins on this chain are allowed to dispatch XCM sends/executions.
pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RococoNetwork>;
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RococoNetwork>;
/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
@@ -431,16 +431,16 @@ pub type XcmRouter = (
impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type XcmRouter = XcmRouter;
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type XcmExecuteFilter = Everything;
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = frame_support::traits::Nothing;
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
@@ -470,7 +470,7 @@ impl cumulus_pallet_dmp_queue::Config for Runtime {
impl cumulus_ping::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
}