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

enable code-reuse for partial fill fraction calculations #3223

Closed
cbeck88 opened this issue Mar 11, 2023 · 1 comment
Closed

enable code-reuse for partial fill fraction calculations #3223

cbeck88 opened this issue Mar 11, 2023 · 1 comment
Assignees

Comments

@cbeck88
Copy link
Contributor

cbeck88 commented Mar 11, 2023

In several places in the code around input rule validation, transaction building with SCIs, and soon mobilecoind, we will have code that performs fractional calculations with u64's by widening to u128's and then multiplying and dividing etc.

When I wrote this code Eran pointed out that we should avoid code duplication here, but I didn't see a good way at the time and I didn't do it.

Now I'm thinking, we should have like a utility class like U64Ratio or something that can capture a lot of this logic, and make it easier for it to work the same way everywhere.

I'm not sure I want to do this in the release/v4.1 branch, but I'd like to do it in master for 5.0 or something.

@cbeck88
Copy link
Contributor Author

cbeck88 commented Mar 13, 2023

this is addressed in: #3214

and: #3224

with the U64Ratio class

@cbeck88 cbeck88 self-assigned this Mar 13, 2023
@cbeck88 cbeck88 closed this as completed Mar 16, 2023
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

No branches or pull requests

1 participant