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

fix: support for calculating fees for statemint, and statemine and their test nets. #613

Merged
merged 3 commits into from
Jul 17, 2021

Conversation

TarikGul
Copy link
Member

Update the calc package to support the Multiplier for statemint and statemine and their testnets. Update the configs and separate statemint from statmine. Everything has been tested locally with the calc package.

After this PR is merged, it should be followed up by a PR to release and update the calc package.

("statemint", _v) => V2(new_u128(inner)),

("westmine", _v) => V2(new_u128(inner)),
("westmint", _v) => V2(new_u128(inner)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you consider swapping around the logic a bit here; just check for the weird cases and give every one else new_i128 by default?

Copy link
Member Author

@TarikGul TarikGul Jul 15, 2021

Choose a reason for hiding this comment

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

I see what you are saying. Kinda like the equivalent of ending the match statement with a

/// account for defaults
_ => V1((new_i128(inner), false)),

I did think about this, and in all honesty I am kinda on the fence on whether it would be appropriate for @substrate/calc to give a default Multiplier or not. We enforce third party chains to update their own fee configuration through the controller-configs. Meaning if they don't have a minCalcFeeRuntime in the configuration they wont calculate fees. Then they would have to add their match case inside of the rust package as well which allows for zero possible errors on our side or assumptions on another chains fee calculation.

But at the same time, as a package it makes sense for the Multiplier to have some kind of default value because then it can support more than just Polkadot, Kusama, parity testnets, and parity parachains.

@TarikGul TarikGul merged commit cea7c36 into master Jul 17, 2021
@TarikGul TarikGul deleted the tarik-statemine branch July 17, 2021 03:05
This pull request was closed.
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.

3 participants