-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
unreachable to ord for amount #228
unreachable to ord for amount #228
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #228 +/- ##
======================================
Coverage 17.6% 17.6%
======================================
Files 37 37
Lines 7535 7535
======================================
Hits 1323 1323
Misses 6212 6212
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
src/interface/contract.rs
Outdated
AmountChange::Dec(neg) if *neg < add => AmountChange::Inc(add - *neg), | ||
AmountChange::Dec(_) => unreachable!(), | ||
AmountChange::Dec(neg) => match add.cmp(neg) { | ||
Ordering::Greater => AmountChange::Dec(*neg - add), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be less, not greater, since we reverse the order neg
and add
are compared
Ordering::Greater => AmountChange::Dec(*neg - add), | |
Ordering::Less => AmountChange::Dec(*neg - add), |
I already asked few times to use rebases instead of useless multiple merges of |
Background:
Based on #227, there is also an
unreachable
in the rgb20 amount, so I think maybe we can change to theOrd
in order to get rid of unreachable.Description:
remove the
unreachable
in the rgb20 amount state change, then use theOrd
. Similar to the rgb21 owed fraction state change.