From 30006cc1ec7a1ae2cd6e5857bd0f6c6566a5e727 Mon Sep 17 00:00:00 2001 From: Roznovjak Date: Thu, 19 Dec 2024 16:35:46 +0100 Subject: [PATCH] XcmDryRunApi --- runtime/basilisk/src/apis.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/runtime/basilisk/src/apis.rs b/runtime/basilisk/src/apis.rs index 387c15fbed..5289a0941f 100644 --- a/runtime/basilisk/src/apis.rs +++ b/runtime/basilisk/src/apis.rs @@ -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 for Runtime { @@ -247,6 +250,16 @@ impl_runtime_apis! { } } + impl xcm_runtime_apis::dry_run::DryRunApi for Runtime { + fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::(origin, call) + } + + fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm) -> Result, XcmDryRunApiError> { + PolkadotXcm::dry_run_xcm::(origin_location, xcm) + } + } + impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { fn can_build_upon( included_hash: ::Hash,