Skip to content

Add XcmPayment runtime API#2857

Merged
Agusrodri merged 5 commits intomasterfrom
agustin-xcm-payment-api
Jul 11, 2024
Merged

Add XcmPayment runtime API#2857
Agusrodri merged 5 commits intomasterfrom
agustin-xcm-payment-api

Conversation

@Agusrodri
Copy link
Copy Markdown
Contributor

@Agusrodri Agusrodri commented Jul 1, 2024

What does it do?

Adds the new runtime API called XcmPaymentApi, which allows to fetch the following information:

  • A list of allowed assets for XCM execution payment.
  • A weight-to-asset fee conversion (as long as the indicated asset is allowed to be used for execution payment).
  • Retrieves the weight estimation for a specific XCM message.
  • Retrieves the amount of XCM delivery fees (if any) for a specific XCM message to a specific destination.

More context on: paritytech/polkadot-sdk#3607

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 1, 2024

Coverage Report

@@                     Coverage Diff                     @@
##           master   agustin-xcm-payment-api      +/-   ##
===========================================================
+ Coverage   81.10%                    81.26%   +0.16%     
+ Files         274                       301      +27     
+ Lines       80576                     85781    +5205     
===========================================================
+ Hits        65348                     69704    +4356     
+ Misses      15228                     16077     +849     
Files Changed Coverage
/client/rpc/finality/src/lib.rs 95.92% (+7.78%) 🔼
/pallets/parachain-staking/src/lib.rs 91.73% (-0.01%) 🔽
/pallets/parachain-staking/src/mock.rs 97.65% (+0.02%) 🔼
/pallets/parachain-staking/src/tests.rs 91.39% (+0.03%) 🔼
/precompiles/xcm-transactor/src/v1/mod.rs 87.95% (+0.45%) 🔼
/precompiles/xcm-transactor/src/v2/mod.rs 76.42% (-2.22%) 🔽
/precompiles/xcm-transactor/src/v3/mod.rs 83.33% (-2.26%) 🔽
/precompiles/xcm-utils/src/lib.rs 90.98% (-0.69%) 🔽
/runtime/common/src/apis.rs 28.40% (-2.12%) 🔽

Coverage generated Wed Jul 10 22:13:43 UTC 2024

@Agusrodri Agusrodri added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. not-breaking Does not need to be mentioned in breaking changes labels Jul 4, 2024
@Agusrodri Agusrodri marked this pull request as ready for review July 4, 2024 00:31
Comment thread runtime/moonbeam/src/lib.rs
@RomarQ
Copy link
Copy Markdown
Contributor

RomarQ commented Jul 5, 2024

About the test, could we use the fees calculated and do an xcm call to make sure the estimated value is enough?

librelois
librelois previously approved these changes Jul 5, 2024
@Agusrodri
Copy link
Copy Markdown
Contributor Author

About the test, could we use the fees calculated and do an xcm call to make sure the estimated value is enough?

@RomarQ I just added two tests (one for native fees and another one for foreign fees) in 391b636 :)

@Agusrodri Agusrodri requested review from RomarQ and librelois July 10, 2024 21:26
@Agusrodri Agusrodri merged commit 31b3f8c into master Jul 11, 2024
@Agusrodri Agusrodri deleted the agustin-xcm-payment-api branch July 11, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. not-breaking Does not need to be mentioned in breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants