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!: WithFee::with_fee method #263

Merged
merged 4 commits into from
May 27, 2021
Merged

fix!: WithFee::with_fee method #263

merged 4 commits into from
May 27, 2021

Conversation

Roznovjak
Copy link
Contributor

Description

fix WithFee::with_fee() method and also add without_fee() method.

https://github.com/galacticcouncil/HydraDX-node/blob/694cce69ee44890dcbd05c9ef1cd83079e3ce1ac/primitives/src/lib.rs#L121-L124

The current implementation computes value * (100% - fee_percentage) instead of value + fee

@jak-pan jak-pan changed the title fix!: fix WithFee::with_fee method fix!: WithFee::with_fee method May 26, 2021
Copy link
Contributor

@enthusiastmartin enthusiastmartin left a comment

Choose a reason for hiding this comment

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

looks ok to me. but i am not very convinced that we need to update all versions of all pallets and runtime too.

I would just update the primitives crate version.

@Roznovjak
Copy link
Contributor Author

What do you think @jak-pan ? It is a breaking change, but the affected method was never used before in the code( at least not in this repository).

@jak-pan
Copy link
Contributor

jak-pan commented May 27, 2021

Just runtime and impl_version in runtime. Where else is this used?

@Roznovjak
Copy link
Contributor Author

We don't use with_fee() in our node repositories. We also need without_fee method in LBP so I have implemented it. I am not sure if I answered your question.

@jak-pan
Copy link
Contributor

jak-pan commented May 27, 2021

Only runtime then.

@Roznovjak
Copy link
Contributor Author

I have reverted impl_runtime version to the previous one. The only version changes are now in primitives and runtime package.

@enthusiastmartin enthusiastmartin merged commit 75f7ec0 into master May 27, 2021
@Roznovjak Roznovjak deleted the fix/fee_struct branch May 27, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants