From efe9b2887fb81d89585e4dfe410e482121e23fde Mon Sep 17 00:00:00 2001 From: Diego Date: Tue, 24 Dec 2024 11:48:25 -0300 Subject: [PATCH] Missing fixes --- .../node/tanssi-relay-service/src/dev_rpcs.rs | 19 ++++++++++++++++--- solo-chains/runtime/dancelight/src/lib.rs | 12 ++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/solo-chains/node/tanssi-relay-service/src/dev_rpcs.rs b/solo-chains/node/tanssi-relay-service/src/dev_rpcs.rs index 181bc9737..69c6ce86c 100644 --- a/solo-chains/node/tanssi-relay-service/src/dev_rpcs.rs +++ b/solo-chains/node/tanssi-relay-service/src/dev_rpcs.rs @@ -79,10 +79,23 @@ impl DevApiServer for DevRpc { let upward_message_channel = self.upward_message_channel.clone(); // If no message is supplied, inject a default one. let msg = if msg.is_empty() { - // TODO: recheck this + // Note: Sovereign account of the origin parachain must be funded before injecting the message. xcm::VersionedXcm::<()>::V4(Xcm(vec![ - ReserveAssetDeposited((Parent, 10000000000000u128).into()), - ClearOrigin, + WithdrawAsset((Here, 10000000000000u128).into()), + BuyExecution { + fees: (Here, 10000000000000u128).into(), + weight_limit: Unlimited, + }, + DepositAsset { + assets: AllCounted(1).into(), + beneficiary: Location::new( + 0, + [AccountKey20 { + network: None, + key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"), + }], + ), + }, ])) .encode() } else { diff --git a/solo-chains/runtime/dancelight/src/lib.rs b/solo-chains/runtime/dancelight/src/lib.rs index 98b2255b7..cfc000daa 100644 --- a/solo-chains/runtime/dancelight/src/lib.rs +++ b/solo-chains/runtime/dancelight/src/lib.rs @@ -2257,6 +2257,18 @@ sp_api::impl_runtime_apis! { } } + impl xcm_runtime_apis::conversions::LocationToAccountApi for Runtime { + fn convert_location(location: VersionedLocation) -> Result< + AccountId, + xcm_runtime_apis::conversions::Error + > { + xcm_runtime_apis::conversions::LocationToAccountHelper::< + AccountId, + xcm_config::LocationConverter, + >::convert_location(location) + } + } + impl sp_api::Metadata for Runtime { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into())