-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add enforcement of valid integer range to Number #6000
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
Draft
ximinez
wants to merge
35
commits into
develop
Choose a base branch
from
ximinez/lending-number
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+932
−110
Draft
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
3cb447a
Add optional enforcement of valid integer range to Number
ximinez 24f37d7
Make all STNumber fields "soeDEFAULT"
ximinez b605a2c
Add integer enforcement when converting to XRP/MPTAmount to Number
ximinez cb6df19
Fix build error - avoid copy
ximinez 0175dd7
Catch up the consequences of Number changes
ximinez 8e56af2
Add a distinction between a "valid" and a "representable" Number
ximinez fabc7bd
Merge branch 'develop' into ximinez/lending-number
ximinez edb9b16
fix: Use ".value()" instead of "->" when with STObject::Proxy objects
ximinez 1648ead
Merge branch 'develop' into ximinez/lending-number
ximinez a45b43e
Update include/xrpl/basics/Number.h
ximinez ff9270b
Merge branch 'develop' into ximinez/lending-number
ximinez a3db23e
Merge remote-tracking branch 'XRPLF/develop' into ximinez/lending-number
ximinez 5845c5c
Merge branch 'develop' into ximinez/lending-number
ximinez 2854e6b
Merge branch 'develop' into ximinez/lending-number
ximinez 8822b53
Rip out about half the code: levels, enforcement, and STAmount changes
ximinez 596365d
fixup! Rip out about half the code: levels, enforcement, and STAmount…
ximinez 7974545
Fixes build errors and test failures
ximinez bba4b44
fix: Number: Do not attempt to take the negative of an unsigned
ximinez 2338c55
test fix: Remove cases with Vault scale 18
ximinez 67796cf
Change the vaultMaximumIOUScale from 13 to 15
ximinez 2e02c33
Expand the description of Number::isInteger_
ximinez 6503e6d
Merge branch 'develop' into ximinez/lending-number
ximinez 1e47c76
Rewrite to clarify Number limitations, enforce limits in conversion
ximinez 82553c2
Avoid some null dereferences in tests
ximinez dc283ce
Add a couple of high value MPT tests
ximinez 687b9cc
Add an RAII NumberIntegerOverflowGuard class, and update tests
ximinez 9fae186
Fix large integer overflow
ximinez bd9346a
Fix Vault tests due to Number changes
ximinez 3b421cd
More test and logging updates
ximinez f9293e6
Set the global rules for every transaction step
ximinez 3868158
Merge branch 'develop' into ximinez/lending-number
ximinez e130119
Merge branch 'develop' into ximinez/lending-number
ximinez 9ab1734
Merge branch 'develop' into ximinez/lending-number
ximinez 7b31969
Merge branch 'develop' into ximinez/lending-number
ximinez 2e9bdb9
Merge branch 'develop' into ximinez/lending-number
ximinez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
how was this number chosen? could we have chosen a larger value?
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.
There's a discussion in the comments in https://ripplelabs.atlassian.net/browse/RIPD-4045.
Since that's not public, the tl;dr is that I started with
maxMantissa / 10, which would give theSTNumberfields inVaultroom to grow if they get, for example, extra interest from a special case payment in aLoan. I was concerned that wouldn't be enough overhead. The answer wasThis is intended to be a temporary solution to get the feature available without a major rewrite. A fuller solution should be available in a version or two which allows the entire range of valid numbers.