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

Using PreciseNumber for underlaying calculations #2

Merged
merged 6 commits into from
Nov 8, 2024

Conversation

coachchucksol
Copy link
Collaborator

All arithmetic should be done using PreciseNumber

Comment on lines 95 to 101
pub fn token_supply_to_precise_number(
token_supply: u64,
) -> Result<PreciseNumber, TipRouterError> {
let value = Self::from_token_supply(token_supply)?;

value.number.to_precise_number()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this method is slightly different than the PreciseWeight version of it -- can we keep it standard so these wrappers are more intuitive to interact with

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make into PodPreciseNumber

use from and into

core/src/weight_table.rs Outdated Show resolved Hide resolved
core/src/weight_table.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@ebatsell ebatsell left a comment

Choose a reason for hiding this comment

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

LGTM once tests are passing

@coachchucksol coachchucksol merged commit a16f795 into master Nov 8, 2024
4 of 5 checks passed
@coachchucksol coachchucksol deleted the ck/weight_table branch November 8, 2024 16:28
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.

2 participants