Closed dan-da closed 3 years ago
@davidrusu thx for the comments. just fyi, I will be updating this with a substantial simplification soon, and will incorporate your suggestions.
I have further refactored and was able to remove rug dependency entirely.... ie no more rug::Rational, rug::Integer. I like it because it reduces the code size/footprint in sn_dbc, all integer math and no need to compile gmp library.
The main things we lose are:
But these are not things the Mint needs and perhaps not most clients.
Anyway, I'm creating a helper crate for client use (possibly) that has the removed logic in an AmountRational struct. Just to keep the code around in case it's useful at some point.... it took me a lot of work and head scratching to get impl From<Rational> for Amount
working. ;)
Thanks for the heads up, let me know when the new work is ready for review
@davidrusu ready for review when you have a chance.
rebased on latest drusu/mint_blind_sigs_fork_squashed
Still have a few clippy failures
Still have a few clippy failures
hmm, do you mean in the bench maybe? looks clean here.
$ cargo clippy
Finished dev [unoptimized + debuginfo] target(s) in 0.36s
$ cargo clippy --tests
Checking sn_dbc v2.7.1 (/home/danda/dev/maidsafe/sn_dbc)
Finished dev [unoptimized + debuginfo] target(s) in 1.83s
improves correctness and comments for Amount, Denomination and adds test cases for Amount.