Skip to content

Commit

Permalink
XcmDryRunApi
Browse files Browse the repository at this point in the history
  • Loading branch information
Roznovjak committed Dec 19, 2024
1 parent 2563a14 commit 30006cc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion runtime/basilisk/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ use polkadot_xcm::{IntoVersion, VersionedAssetId, VersionedAssets, VersionedLoca
use primitives::constants::chain::CORE_ASSET_ID;
use sp_api::impl_runtime_apis;
use sp_core::{Get, OpaqueMetadata};
use xcm_runtime_apis::fees::Error as XcmPaymentApiError;
use xcm_runtime_apis::{
dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects},
fees::Error as XcmPaymentApiError,
};

impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
Expand Down Expand Up @@ -247,6 +250,16 @@ impl_runtime_apis! {
}
}

impl xcm_runtime_apis::dry_run::DryRunApi<Block, RuntimeCall, RuntimeEvent, OriginCaller> for Runtime {
fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result<CallDryRunEffects<RuntimeEvent>, XcmDryRunApiError> {
PolkadotXcm::dry_run_call::<Runtime, xcm::XcmRouter, OriginCaller, RuntimeCall>(origin, call)
}

fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>) -> Result<XcmDryRunEffects<RuntimeEvent>, XcmDryRunApiError> {
PolkadotXcm::dry_run_xcm::<Runtime, xcm::XcmRouter, RuntimeCall, xcm::XcmConfig>(origin_location, xcm)
}
}

impl cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> for Runtime {
fn can_build_upon(
included_hash: <Block as BlockT>::Hash,
Expand Down

0 comments on commit 30006cc

Please sign in to comment.