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

Add delivery fees #479

Merged
merged 28 commits into from
Apr 5, 2024
Merged

Add delivery fees #479

merged 28 commits into from
Apr 5, 2024

Conversation

girazoki
Copy link
Collaborator

@girazoki girazoki commented Mar 27, 2024

Add delivery fees for XCM routers in all runtimes (except Flashbox). We use ExpontentialPrice from polkadot-runtime-common and we charge in the native asset for each runtime.

Added a couple function in TS so that we can check that indeed the messages are correctly charged. These take the latest fees from the sent messages available in storage

@girazoki girazoki changed the title Girazoki add delivery fees Add delivery fees Mar 27, 2024
Copy link
Contributor

github-actions bot commented Mar 27, 2024

Coverage Report

(master)

@@                      Coverage Diff                      @@
##           master   girazoki-add-delivery-fees     +/-   ##
=============================================================
  Coverage   64.81%                       64.81%   0.00%     
  Files          66                           66             
  Lines        9906                         9906             
=============================================================
  Hits         6420                         6420             
  Misses       3486                         3486             
Files Changed Coverage

Coverage generated Fri Apr 5 11:00:13 UTC 2024

Base automatically changed from girazoki-tests-reserve-transfers to master March 29, 2024 18:25
@girazoki girazoki marked this pull request as ready for review April 2, 2024 15:57
@girazoki girazoki requested a review from Agusrodri April 2, 2024 15:58
@girazoki girazoki added a0-pleasereview Pull request needs code review. 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. breaking Needs to be mentioned in breaking changes labels Apr 2, 2024
@girazoki girazoki requested a review from ParthDesai April 2, 2024 16:03
@girazoki girazoki requested a review from nanocryk April 2, 2024 16:03
return filteredEvents[0]!.data[1][0].fun.asFungible.toBigInt();
};

export const getLastSentUmpMessageFee = async (context: DevModeContext, baseDelivery: bigint, txByteFee: bigint) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Really useful functions :)

Copy link
Collaborator

@Agusrodri Agusrodri left a comment

Choose a reason for hiding this comment

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

Looks great! Specially the typescript helpers/tests addition 🥇

Copy link
Collaborator

@ParthDesai ParthDesai left a comment

Choose a reason for hiding this comment

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

Minor comment in test. Apart from that everything else look good.

test/util/xcm.ts Outdated Show resolved Hide resolved
@girazoki girazoki merged commit 3b02f29 into master Apr 5, 2024
32 checks passed
@girazoki girazoki deleted the girazoki-add-delivery-fees branch April 5, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a0-pleasereview Pull request needs code review. B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants