Skip to content

Add support for asset V3 to V5 conversion to match_asset of localPay #10581

@dhirajs0

Description

@dhirajs0

Description

The match_asset function in cumulus/parachains/common/src/pay.rs handles conversion of VersionedLocatableAsset to xcm::v5::Location. The V3 to V5 conversion is not supported currently, but since some client are still using he V3 version we need to add support for it.

File: cumulus/parachains/common/src/pay.rs

Code Location

Here

fn match_asset(asset: &VersionedLocatableAsset) -> Result<xcm::v5::Location, ()> {
    match asset {
        // add conversion from V3 to V5 here
        VersionedLocatableAsset::V4 { location, asset_id } if location.is_here() =>
            asset_id.clone().try_into().map(|a: xcm::v5::AssetId| a.0).map_err(|_| ()),
        VersionedLocatableAsset::V5 { location, asset_id } if location.is_here() =>
            Ok(asset_id.clone().0),
        _ => Err(()),
    }
}

Task

Add support for V3 to V5 conversion via V4 in match_asset fn here)

After this is merged and released, Issue #1027 from runtime repo can be addressed.

Metadata

Metadata

Assignees

Labels

C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.T9-cumulusThis PR/Issue is related to cumulus.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions