Skip to content

Commit

Permalink
change(kreivo-runtime): make sure communities can also transact
Browse files Browse the repository at this point in the history
  • Loading branch information
pandres95 committed Apr 14, 2024
1 parent 3bdf935 commit 25229d4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions runtime/kreivo/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,13 @@ impl xcm_executor::Config for XcmConfig {
}

/// Only communities are allowed to dispatch xcm messages
pub type ConvertCommunityOrigin = pallet_communities::Origin<Runtime>;
pub type CanSendXcmMessages = pallet_communities::Origin<Runtime>;

/// Only signed origins are allowed to execute xcm transactions
pub type SignedOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;
pub type CanExecuteXcmTransactions = (
pallet_communities::Origin<Runtime>,
SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>
);

/// The means for routing XCM messages which are not for local execution into
/// the right message queues.
Expand All @@ -251,9 +254,9 @@ pub type XcmRouter = (

impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, ConvertCommunityOrigin>;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, CanSendXcmMessages>;
type XcmRouter = XcmRouter;
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, SignedOriginToLocation>;
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, CanExecuteXcmTransactions>;
type XcmExecuteFilter = Nothing;
// ^ Disable dispatchable execute on the XCM pallet.
type XcmExecutor = XcmExecutor<XcmConfig>;
Expand Down

0 comments on commit 25229d4

Please sign in to comment.