mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 11:35:53 +00:00
Catch up the consequences of Number changes
- Change the Number::maxIntValue to all 9's. - Add integral() to Asset (copied from Lending) - Add toNumber() functions to STAmount, MPTAmount, XRPAmount to allow explicit conversions with enforcement options. - Add optional Number::EnforceInteger options to STAmount and STNumber ctors, conversions, etc. IOUs are never checked. - Update Vault transactors, and helper functions, to check restrictions. - Fix and add Vault tests.
This commit is contained in:
@@ -858,7 +858,7 @@ public:
|
||||
{
|
||||
BEAST_EXPECT(e.what() == "Number::operator= integer overflow"s);
|
||||
// The throw is done _after_ the number is updated.
|
||||
BEAST_EXPECT((a == Number{2, 14}));
|
||||
BEAST_EXPECT((a == Number::maxIntValue * 2));
|
||||
BEAST_EXPECT(!a.valid());
|
||||
}
|
||||
try
|
||||
@@ -870,7 +870,7 @@ public:
|
||||
{
|
||||
BEAST_EXPECT(e.what() == "Number::Number integer overflow"s);
|
||||
// The Number doesn't get updated because the ctor throws
|
||||
BEAST_EXPECT((a == Number{2, 14}));
|
||||
BEAST_EXPECT((a == Number::maxIntValue * 2));
|
||||
BEAST_EXPECT(!a.valid());
|
||||
}
|
||||
a = Number(1, 10);
|
||||
|
||||
Reference in New Issue
Block a user