Skip to content

Commit

Permalink
make docs for LocalOriginToLocation uniform across codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
acatangiu committed Nov 1, 2024
1 parent 2700dbf commit 48cc816
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = PolkadotXcm;
}

/// Converts a local signed origin into an XCM location.
/// Forms the basis for local origins sending/executing XCMs.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

pub type PriceForParentDelivery =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = PolkadotXcm;
}

/// Local origins on this chain are allowed to dispatch XCM sends/executions.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

pub type PriceForParentDelivery =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ impl xcm_executor::Config for XcmConfig {
pub type PriceForParentDelivery =
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, ParachainSystem>;

/// Converts a local signed origin into an XCM location.
/// Forms the basis for local origins sending/executing XCMs.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

/// The means for routing XCM messages which are not for local execution into the right message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ impl xcm_executor::Config for XcmConfig {
pub type PriceForParentDelivery =
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, ParachainSystem>;

/// Converts a local signed origin into an XCM location.
/// Forms the basis for local origins sending/executing XCMs.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

/// The means for routing XCM messages which are not for local execution into the right message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = PolkadotXcm;
}

/// Converts a local signed origin into an XCM location.
/// Forms the basis for local origins sending/executing XCMs.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

pub type PriceForParentDelivery =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = PolkadotXcm;
}

/// Converts a local signed origin into an XCM location.
/// Forms the basis for local origins sending/executing XCMs.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

pub type PriceForParentDelivery =
Expand Down
3 changes: 2 additions & 1 deletion cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ pub type ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger =
ForeignAssetsInstance,
>;

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

pub type PriceForParentDelivery =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = PolkadotXcm;
}

/// Local origins on this chain are allowed to dispatch XCM sends/executions.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RococoNetwork>;

/// The means for routing XCM messages which are not for local execution into the right message
Expand Down
3 changes: 2 additions & 1 deletion polkadot/runtime/westend/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ parameter_types! {
pub type GeneralAdminToPlurality =
OriginToPluralityVoice<RuntimeOrigin, GeneralAdmin, GeneralAdminBodyId>;

/// location of this chain.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = (
GeneralAdminToPlurality,
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = ();
}

/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>;

impl pallet_xcm::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = ();
}

/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>;

impl pallet_xcm::Config for Runtime {
Expand Down
12 changes: 12 additions & 0 deletions polkadot/xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3429,6 +3429,18 @@ where
}
}

/// Filter for `(origin: Location, target: Location)` to find whether `target` has explicitly
/// authorized `origin` to alias it.
///
/// TODO: how to authorize?.
pub struct AuthorizedAliases;
impl ContainsPair<Location, Location> for AuthorizedAliases {
fn contains(origin: &Location, target: &Location) -> bool {
// TODO: use storage
return false
}
}

/// Filter for `Location` to find those which represent a strict majority approval of an
/// identified plurality.
///
Expand Down
2 changes: 2 additions & 0 deletions polkadot/xcm/pallet-xcm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = XcmPallet;
}

/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, AnyNetwork>;

parameter_types! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ parameter_types! {
pub const NoNetwork: Option<NetworkId> = None;
}

/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountIndex64<RuntimeOrigin, AccountId, NoNetwork>;

impl pallet_xcm::Config for Runtime {
Expand Down
2 changes: 2 additions & 0 deletions polkadot/xcm/xcm-builder/src/tests/pay/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ impl MaybeEquivalence<Location, AssetIdForAssets>
}
}

/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, AnyNetwork>;
pub type LocalAssetsTransactor = FungiblesAdapter<
Assets,
Expand Down
2 changes: 2 additions & 0 deletions polkadot/xcm/xcm-builder/tests/mock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = XcmPallet;
}

/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, KusamaNetwork>;

impl pallet_xcm::Config for Runtime {
Expand Down
2 changes: 2 additions & 0 deletions polkadot/xcm/xcm-runtime-apis/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ where
}
}

/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountIndex64<RuntimeOrigin, AccountId>;

impl pallet_xcm::Config for TestRuntime {
Expand Down
3 changes: 2 additions & 1 deletion templates/parachain/runtime/src/configs/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ impl xcm_executor::Config for XcmConfig {
type XcmRecorder = PolkadotXcm;
}

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

/// The means for routing XCM messages which are not for local execution into the right message
Expand Down

0 comments on commit 48cc816

Please sign in to comment.