Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets in pool with native can be used in query_weight_to_asset_fee #6080

Merged
merged 22 commits into from
Oct 22, 2024

Conversation

franciscoaguirre
Copy link
Contributor

A follow-up to #5599. Assets in a pool with the native one are returned from query_acceptable_payment_assets. Now those assets can be used in query_weight_to_asset_fee to get the correct amount that needs to be paid.

@franciscoaguirre franciscoaguirre added T6-XCM This PR/Issue is related to XCM. A4-needs-backport Pull request must be backported to all maintained releases. labels Oct 16, 2024
@franciscoaguirre franciscoaguirre marked this pull request as ready for review October 18, 2024 11:48
@franciscoaguirre
Copy link
Contributor Author

bot fmt

@command-bot
Copy link

command-bot bot commented Oct 18, 2024

@franciscoaguirre https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7599192 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 22-f59fc7a9-be44-4b58-92bb-90dc4f64603e to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Oct 18, 2024

@franciscoaguirre Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7599192 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7599192/artifacts/download.

Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good modulo this comment which should be fixed

@franciscoaguirre
Copy link
Contributor Author

Addressing

@franciscoaguirre
Copy link
Contributor Author

bot fmt

@command-bot
Copy link

command-bot bot commented Oct 21, 2024

@franciscoaguirre https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7613871 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 6-2c36f9b3-5067-496c-98c9-ebddd71d0217 to cancel this command or bot cancel to cancel all commands in this pull request.

@franciscoaguirre
Copy link
Contributor Author

bot fmt

@command-bot
Copy link

command-bot bot commented Oct 22, 2024

@franciscoaguirre https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7620641 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 22-b28eaba1-7afe-4c72-88e1-20fee5a5055e to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Oct 22, 2024

@franciscoaguirre Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7620641 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7620641/artifacts/download.

Comment on lines +1437 to +1439
.into_iter()
.map(|asset_id| asset_id.0)
.any(|location| location == native_asset) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this compiles like this or maybe &native_asset

Suggested change
.into_iter()
.map(|asset_id| asset_id.0)
.any(|location| location == native_asset) {
.iter()
.any(|asset_id| asset_id.0 == native_asset) {

Comment on lines +1476 to +1478
.into_iter()
.map(|asset_id| asset_id.0)
.any(|location| location == native_asset) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.into_iter()
.map(|asset_id| asset_id.0)
.any(|location| location == native_asset) {
.iter()
.any(|asset_id| asset_id.0 == native_asset) {

let assets_in_pool_with_native = assets_common::get_assets_in_pool_with::<
Runtime,
xcm::v4::Location
>(&native_token).map_err(|()| XcmPaymentApiError::VersionedConversionFailed)?.into_iter();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .into_iter() is not needed now

Suggested change
>(&native_token).map_err(|()| XcmPaymentApiError::VersionedConversionFailed)?.into_iter();
>(&native_token).map_err(|()| XcmPaymentApiError::VersionedConversionFailed)?;

let assets_in_pool_with_native = assets_common::get_assets_in_pool_with::<
Runtime,
xcm::v4::Location
>(&native_token).map_err(|()| XcmPaymentApiError::VersionedConversionFailed)?.into_iter();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>(&native_token).map_err(|()| XcmPaymentApiError::VersionedConversionFailed)?.into_iter();
>(&native_token).map_err(|()| XcmPaymentApiError::VersionedConversionFailed)?;

@franciscoaguirre franciscoaguirre added this pull request to the merge queue Oct 22, 2024
Merged via the queue into master with commit b4732ad Oct 22, 2024
193 of 197 checks passed
@franciscoaguirre franciscoaguirre deleted the query-weight-to-asset-fee-multiple-assets branch October 22, 2024 22:29
@paritytech-cmd-bot-polkadot-sdk

Created backport PR for stable2407:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-6080-to-stable2407
git worktree add --checkout .worktree/backport-6080-to-stable2407 backport-6080-to-stable2407
cd .worktree/backport-6080-to-stable2407
git reset --hard HEAD^
git cherry-pick -x b4732add46910370443d092a3f479986060f6df5
git push --force-with-lease

@paritytech-cmd-bot-polkadot-sdk

Created backport PR for stable2409:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-6080-to-stable2409
git worktree add --checkout .worktree/backport-6080-to-stable2409 backport-6080-to-stable2409
cd .worktree/backport-6080-to-stable2409
git reset --hard HEAD^
git cherry-pick -x b4732add46910370443d092a3f479986060f6df5
git push --force-with-lease

mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…paritytech#6080)

A follow-up to paritytech#5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…paritytech#6080)

A follow-up to paritytech#5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…paritytech#6080)

A follow-up to paritytech#5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…paritytech#6080)

A follow-up to paritytech#5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 25, 2024
…paritytech#6080)

A follow-up to paritytech#5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 29, 2024
…paritytech#6080)

A follow-up to paritytech#5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
mordamax pushed a commit to paritytech-stg/polkadot-sdk that referenced this pull request Oct 29, 2024
…paritytech#6080)

A follow-up to paritytech#5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
franciscoaguirre added a commit that referenced this pull request Nov 6, 2024
…#6080)

A follow-up to #5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
(cherry picked from commit b4732ad)
franciscoaguirre added a commit that referenced this pull request Nov 8, 2024
…#6080)

A follow-up to #5599.
Assets in a pool with the native one are returned from
`query_acceptable_payment_assets`. Now those assets can be used in
`query_weight_to_asset_fee` to get the correct amount that needs to be
paid.

---------

Co-authored-by: command-bot <>
(cherry picked from commit b4732ad)
EgorPopelyaev added a commit that referenced this pull request Nov 12, 2024
Backport #6080 into `stable2409` from franciscoaguirre.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Egor_P <egor@parity.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A4-needs-backport Pull request must be backported to all maintained releases. T6-XCM This PR/Issue is related to XCM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants