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

Use MultiLocation for tx fee payment instead of u32 #1403

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

Chralt98
Copy link
Member

@Chralt98 Chralt98 commented Jan 24, 2025

What does it do?

The asset id of pallet_asset_tx_payment is replaced by MultiLocation from u32. This is useful to adapt to the newest polkadot-api and polkadot-extension since their default implementation expects a MultiLocation.

What important points should reviewers know?

pallet_asset_tx_payment will fail for a transaction in the standalone mode. However, using the transaction_payment pallet, ZTG can still be used in this case.

The PR was tested against a local network forked using chopsticks. I could execute transactions using USDC from AssetHub as fee payment asset.

Screenshot from 2025-01-30 09-52-59

It is important to know that in case the Polkadot API team doesn't incorporate the suggested PR from us, we could still fix the issue mentioned below by using an override as implemented here.

UPDATE: It is important to use a polkadot API types version that includes this PR, otherwise we would need the override described above. This is the case for a polkadot api version higher than or equal to 15.5.2.

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues?

polkadot-js/api#5846 (comment)
polkadot-js/api#6074

polkadot-js/api#6081
polkadot-js/api#6083

References

@Chralt98 Chralt98 added the s:in-progress The pull requests is currently being worked on label Jan 24, 2025
@Chralt98 Chralt98 self-assigned this Jan 24, 2025
@Chralt98 Chralt98 requested a review from sea212 as a code owner January 24, 2025 08:40
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Jan 28, 2025
@mergify mergify bot added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Jan 28, 2025
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Jan 28, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.19%. Comparing base (ca88b16) to head (7bfcc56).
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1403   +/-   ##
=======================================
  Coverage   93.19%   93.19%           
=======================================
  Files         131      131           
  Lines       29241    29241           
=======================================
  Hits        27252    27252           
  Misses       1989     1989           
Flag Coverage Δ
tests 93.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Chralt98 Chralt98 added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Jan 29, 2025
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Jan 29, 2025
@mergify mergify bot added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Jan 29, 2025
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Jan 29, 2025
@Chralt98 Chralt98 added s:accepted This pull request is ready for merge and removed s:review-needed The pull request requires reviews labels Jan 30, 2025
@Chralt98 Chralt98 merged commit 940a8d8 into main Jan 30, 2025
41 checks passed
@Chralt98 Chralt98 deleted the chralt98-multilocation-fee-asset-id branch January 30, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:accepted This pull request is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants