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

feat: Substrate Percentage Fee #297

Merged
merged 12 commits into from
Sep 20, 2023
Merged

feat: Substrate Percentage Fee #297

merged 12 commits into from
Sep 20, 2023

Conversation

FSM1
Copy link
Contributor

@FSM1 FSM1 commented Aug 22, 2023

Description

Added a helper to fetch the fee type from the FeeRouter pallet.
Added logic to handle calculating the fee if the selected resource is configured to use the Percentage fee type.

Related Issue Or Context

Closes: #291

How Has This Been Tested? Testing details.

Fee is correctly calculated.
Tests were done on local env, with both min and max fee tested.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in chainbridge-docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

@FSM1 FSM1 changed the title Substrate Percentage Fee feat: Substrate Percentage Fee Aug 22, 2023
@FSM1 FSM1 self-assigned this Aug 23, 2023
@FSM1 FSM1 marked this pull request as draft August 23, 2023 10:13
@FSM1
Copy link
Contributor Author

FSM1 commented Aug 23, 2023

@MakMuftic the code for handling % based fees is here, both for EVM and substrate.

No tests have been added yet.

I've tested the getFee method with percentage fee handler on substrate side, but not EVM.

Since I didn't have publish rights for the sygma-contracts npm package, I published a version under my own name space. Once this has been published correctly the import needs to be updated.

@FSM1 FSM1 marked this pull request as ready for review September 15, 2023 12:55
@FSM1 FSM1 requested a review from wainola September 15, 2023 13:04
Copy link
Contributor

@mpetrun5 mpetrun5 left a comment

Choose a reason for hiding this comment

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

LGTM

@FSM1 FSM1 merged commit 97eadc5 into main Sep 20, 2023
@FSM1 FSM1 deleted the feat/substrate-percentage-fee branch September 20, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add % based fee support
4 participants