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
@@ -52,7 +52,7 @@ where
T: pallet_xcm::Config + frame_system::Config + pallet_alliance::Config<I>,
[u8; 32]: From<AccountIdOf<T>>,
BalanceOf<T, I>: Into<Fungibility>,
<<T as frame_system::Config>::Origin as OriginTrait>::AccountId: From<AccountIdOf<T>>,
<<T as frame_system::Config>::RuntimeOrigin as OriginTrait>::AccountId: From<AccountIdOf<T>>,
{
fn on_unbalanced(amount: NegativeImbalanceOf<T, I>) {
let temp_account: AccountIdOf<T> = TempAcc::get();
@@ -62,7 +62,7 @@ where
<CurrencyOf<T, I>>::resolve_creating(&temp_account, amount);
let result = pallet_xcm::Pallet::<T>::teleport_assets(
<T as frame_system::Config>::Origin::signed(temp_account.into()),
<T as frame_system::Config>::RuntimeOrigin::signed(temp_account.into()),
Box::new(Parent.into()),
Box::new(
Junction::AccountId32 { network: NetworkId::Any, id: treasury_acc.into() }
@@ -162,7 +162,7 @@ impl frame_system::Config for Runtime {
type Hashing = BlakeTwo256;
type Header = Header;
type RuntimeEvent = RuntimeEvent;
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
type BlockHashCount = BlockHashCount;
type DbWeight = RocksDbWeight;
type Version = Version;
@@ -439,7 +439,7 @@ pub const ALLIANCE_MAX_MEMBERS: u32 = 100;
type AllianceCollective = pallet_collective::Instance1;
impl pallet_collective::Config<AllianceCollective> for Runtime {
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = AllianceMotionDuration;
@@ -14,8 +14,8 @@
// limitations under the License.
use super::{
AccountId, Balances, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall,
RuntimeEvent, WeightToFee, XcmpQueue,
AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall,
RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue,
};
use frame_support::{
match_types, parameter_types,
@@ -41,7 +41,7 @@ use xcm_executor::XcmExecutor;
parameter_types! {
pub const DotLocation: MultiLocation = MultiLocation::parent();
pub const RelayNetwork: 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 const Local: MultiLocation = Here.into();
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
@@ -80,21 +80,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 convert 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<RelayNetwork, Origin>,
// `RuntimeOrigin::Signed` origin of the same 32-byte value.
SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>,
// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
XcmPassthrough<Origin>,
XcmPassthrough<RuntimeOrigin>,
);
parameter_types! {
@@ -154,7 +154,7 @@ impl xcm_executor::Config for XcmConfig {
/// Converts a local signed origin into an XCM multilocation.
/// Forms the basis for local origins sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNetwork>;
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;
/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
@@ -168,10 +168,10 @@ pub type XcmRouter = (
impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
// We want to disallow users sending (arbitrary) XCMs from this chain.
type SendXcmOrigin = EnsureXcmOrigin<Origin, ()>;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, ()>;
type XcmRouter = XcmRouter;
// We support local origins dispatching XCM executions in principle...
type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
// ... but disallow generic XCM execution. As a result only teleports are allowed.
type XcmExecuteFilter = Nothing;
type XcmExecutor = XcmExecutor<XcmConfig>;
@@ -179,7 +179,7 @@ impl pallet_xcm::Config for Runtime {
type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location.
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;