Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/robonet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
uses: actions/checkout@v5

- uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
experimental-features = nix-command flakes
accept-flake-config = true

- name: Run integration tests
run: nix develop .#robonet --command robonet test
2 changes: 1 addition & 1 deletion runtime/robonomics/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn robonomics_genesis(
})
.collect(),
},
polkadot_xcm: PolkadotXcmConfig {
xcm_pallet: XcmPalletConfig {
safe_xcm_version: Some(xcm_version::SAFE_XCM_VERSION)
},
sudo: SudoConfig {
Expand Down
22 changes: 11 additions & 11 deletions runtime/robonomics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ mod runtime {
pub type XcmpQueue = cumulus_pallet_xcmp_queue;

#[runtime::pallet_index(71)]
pub type PolkadotXcm = pallet_xcm;
pub type XcmPallet = pallet_xcm;

#[runtime::pallet_index(72)]
pub type CumulusXcm = cumulus_pallet_xcm;
Expand Down Expand Up @@ -927,33 +927,33 @@ impl_runtime_apis! {
// Currently only the native token (LocalLocation) is accepted for XCM fees
// Additional assets can be added here when multi-asset fee payment is supported
let acceptable_assets = vec![AssetId(xcm_config::LocalLocation::get())];
PolkadotXcm::query_acceptable_payment_assets(xcm_version, acceptable_assets)
XcmPallet::query_acceptable_payment_assets(xcm_version, acceptable_assets)
}

fn query_weight_to_asset_fee(weight: Weight, asset: xcm::VersionedAssetId) -> Result<u128, xcm_runtime_apis::fees::Error> {
type Trader = <xcm_config::XcmConfig as xcm_executor::Config>::Trader;
PolkadotXcm::query_weight_to_asset_fee::<Trader>(weight, asset)
XcmPallet::query_weight_to_asset_fee::<Trader>(weight, asset)
}

fn query_xcm_weight(message: xcm::VersionedXcm<()>) -> Result<Weight, xcm_runtime_apis::fees::Error> {
PolkadotXcm::query_xcm_weight(message)
XcmPallet::query_xcm_weight(message)
}

fn query_delivery_fees(destination: xcm::VersionedLocation, message: xcm::VersionedXcm<()>, asset_id: xcm::VersionedAssetId) -> Result<xcm::VersionedAssets, xcm_runtime_apis::fees::Error> {
type AssetExchanger = <xcm_config::XcmConfig as xcm_executor::Config>::AssetExchanger;
PolkadotXcm::query_delivery_fees::<AssetExchanger>(destination, message, asset_id)
XcmPallet::query_delivery_fees::<AssetExchanger>(destination, message, asset_id)
}
}

// Note: DryRunApi uses OriginCaller instead of RuntimeOrigin because OriginCaller
// implements the required Encode and TypeInfo traits for the XCM runtime API
impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime {
fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: xcm::Version) -> Result<xcm_runtime_apis::dry_run::CallDryRunEffects<RuntimeEvent>, xcm_runtime_apis::dry_run::Error> {
PolkadotXcm::dry_run_call::<Runtime, xcm_config::XcmRouter, _, _>(origin, call, result_xcms_version)
XcmPallet::dry_run_call::<Runtime, xcm_config::XcmRouter, _, _>(origin, call, result_xcms_version)
}

fn dry_run_xcm(origin_location: xcm::VersionedLocation, xcm: xcm::VersionedXcm<RuntimeCall>) -> Result<xcm_runtime_apis::dry_run::XcmDryRunEffects<RuntimeEvent>, xcm_runtime_apis::dry_run::Error> {
PolkadotXcm::dry_run_xcm::<xcm_config::XcmRouter>(origin_location, xcm)
XcmPallet::dry_run_xcm::<xcm_config::XcmRouter>(origin_location, xcm)
}
}

Expand All @@ -968,21 +968,21 @@ impl_runtime_apis! {

impl xcm_runtime_apis::trusted_query::TrustedQueryApi<Block> for Runtime {
fn is_trusted_reserve(asset: xcm::VersionedAsset, location: xcm::VersionedLocation) -> xcm_runtime_apis::trusted_query::XcmTrustedQueryResult {
PolkadotXcm::is_trusted_reserve(asset, location)
XcmPallet::is_trusted_reserve(asset, location)
}

fn is_trusted_teleporter(asset: xcm::VersionedAsset, location: xcm::VersionedLocation) -> xcm_runtime_apis::trusted_query::XcmTrustedQueryResult {
PolkadotXcm::is_trusted_teleporter(asset, location)
XcmPallet::is_trusted_teleporter(asset, location)
}
}

impl xcm_runtime_apis::authorized_aliases::AuthorizedAliasersApi<Block> for Runtime {
fn authorized_aliasers(target: xcm::VersionedLocation) -> Result<Vec<xcm_runtime_apis::authorized_aliases::OriginAliaser>, xcm_runtime_apis::authorized_aliases::Error> {
PolkadotXcm::authorized_aliasers(target)
XcmPallet::authorized_aliasers(target)
}

fn is_authorized_alias(origin: xcm::VersionedLocation, target: xcm::VersionedLocation) -> Result<bool, xcm_runtime_apis::authorized_aliases::Error> {
PolkadotXcm::is_authorized_alias(origin, target)
XcmPallet::is_authorized_alias(origin, target)
}
}

Expand Down
22 changes: 11 additions & 11 deletions runtime/robonomics/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
///////////////////////////////////////////////////////////////////////////////
use super::{
AccountId, AllPalletsWithSystem, Balances, DealWithFees, MessageQueue, ParachainInfo,
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee,
ParachainSystem, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmPallet,
XcmpQueue, COASE, TREASURY_PALLET_ID,
};
use cumulus_primitives_core::{AggregateMessageOrigin, IsSystem, ParaId};
Expand Down Expand Up @@ -53,7 +53,7 @@ parameter_types! {
pub AssetHubParaId: ParaId = 1000.into();
pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
pub AssetHubTrustedTeleporter: (AssetFilter, Location) = (NativeAssetFilter::get(), AssetHubLocation::get());
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
pub CheckingAccount: AccountId = XcmPallet::check_account();
pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating();
pub const NativeAssetId: AssetId = AssetId(Location::here());
pub const NativeAssetFilter: AssetFilter = Wild(AllOf { fun: WildFungible, id: NativeAssetId::get() });
Expand Down Expand Up @@ -156,7 +156,7 @@ pub type Barrier = TrailingSetTopicAsId<
// Allow local users to buy weight credit.
TakeWeightCredit,
// Expected responses are OK.
AllowKnownQueryResponses<PolkadotXcm>,
AllowKnownQueryResponses<XcmPallet>,
// Allow XCMs with some computed origins to pass through.
WithComputedOrigin<
(
Expand Down Expand Up @@ -190,8 +190,8 @@ pub struct XcmConfig;
impl Config for XcmConfig {
type RuntimeCall = RuntimeCall;
type XcmSender = XcmRouter;
type XcmRecorder = PolkadotXcm;
type XcmEventEmitter = PolkadotXcm;
type XcmRecorder = XcmPallet;
type XcmEventEmitter = XcmPallet;
type AssetTransactor = AssetTransactors;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
type IsReserve = ();
Expand All @@ -204,10 +204,10 @@ impl Config for XcmConfig {
MaxInstructions,
>;
type Trader = UsingComponents<WeightToFee, LocalLocation, AccountId, Balances, DealWithFees>;
type ResponseHandler = PolkadotXcm;
type AssetTrap = PolkadotXcm;
type AssetClaims = PolkadotXcm;
type SubscriptionService = PolkadotXcm;
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
type SubscriptionService = XcmPallet;
type PalletInstancesInfo = AllPalletsWithSystem;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type AssetLocker = ();
Expand All @@ -234,7 +234,7 @@ pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, R
/// queues.
pub type XcmRouter = (
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, ()>,
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, XcmPallet, ()>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
);
Expand Down Expand Up @@ -308,7 +308,7 @@ impl sp_runtime::traits::Convert<ParaId, AggregateMessageOrigin> for ParaIdToSib
impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type ChannelInfo = ParachainSystem;
type VersionWrapper = PolkadotXcm;
type VersionWrapper = XcmPallet;
type XcmpQueue = TransformOrigin<MessageQueue, AggregateMessageOrigin, ParaId, ParaIdToSibling>;
type MaxInboundSuspended = MaxInboundSuspended;
type MaxActiveOutboundChannels = MaxActiveOutboundChannels;
Expand Down
Loading