-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
R4R: Sortable Decimal Bytes #5360
Conversation
0439790
to
b13cace
Compare
Codecov Report
@@ Coverage Diff @@
## master #5360 +/- ##
==========================================
+ Coverage 54.64% 54.68% +0.04%
==========================================
Files 311 311
Lines 18447 18459 +12
==========================================
+ Hits 10080 10094 +14
+ Misses 7595 7593 -2
Partials 772 772
|
Co-Authored-By: Jack Zampolin <jack.zampolin@gmail.com>
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.
ACK, missing changelog entry
Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
…smos-sdk into sunny/sortabledecbytes
Added tests to check negatives, MaxSortableDec, -MaxSortableDec, and out of bound panics. |
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.
ACK
Added a function that creates a byte representation of
sdk.Dec
that is sortable. Can be used in ordered key queues, so that inserted keys are sorted. Similar to thesdk.SortableTimeFormat
fortime.Time
.Example use cases:
Orderbooks: https://github.com/sunnya97/sdk-dex-mvp/tree/master/x/orderbook
Kava CDP Liquidation Ratios: Requested by @karzak
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added a relevant changelog entry to the
Unreleased
section inCHANGELOG.md
Re-reviewed
Files changed
in the github PR explorerFor Admin Use: