Skip to content

Commit

Permalink
Missing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dimartiro committed Dec 24, 2024
1 parent 8ddb52b commit efe9b28
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
19 changes: 16 additions & 3 deletions solo-chains/node/tanssi-relay-service/src/dev_rpcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 12 additions & 0 deletions solo-chains/runtime/dancelight/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,18 @@ sp_api::impl_runtime_apis! {
}
}

impl xcm_runtime_apis::conversions::LocationToAccountApi<Block, AccountId> 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<Block> for Runtime {
fn metadata() -> OpaqueMetadata {
OpaqueMetadata::new(Runtime::metadata().into())
Expand Down

0 comments on commit efe9b28

Please sign in to comment.