mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Simplify fee handling during transaction submission:
Avoid custom overflow code; simply use 128-bit math to maintain precision and return a saturated 64-bit value as the final result. Disallow use of negative values in the `fee_mult_max` and `fee_div_max` fields. This change could potentially cause submissions with negative values that would have previously succeeded to now fail.
This commit is contained in:
@@ -42,16 +42,8 @@ public:
|
||||
return f;
|
||||
}();
|
||||
|
||||
BEAST_EXPECT (scaleFeeBase (10000, fees) == 10000);
|
||||
BEAST_EXPECT (scaleFeeLoad (10000, l, fees, false) == 10000);
|
||||
BEAST_EXPECT (scaleFeeBase (1, fees) == 1);
|
||||
BEAST_EXPECT (scaleFeeLoad (1, l, fees, false) == 1);
|
||||
|
||||
// Check new default fee values give same fees as old defaults
|
||||
BEAST_EXPECT (scaleFeeBase (d.FEE_DEFAULT, fees) == 10);
|
||||
BEAST_EXPECT (scaleFeeBase (d.FEE_ACCOUNT_RESERVE, fees) == 200 * SYSTEM_CURRENCY_PARTS);
|
||||
BEAST_EXPECT (scaleFeeBase (d.FEE_OWNER_RESERVE, fees) == 50 * SYSTEM_CURRENCY_PARTS);
|
||||
BEAST_EXPECT (scaleFeeBase (d.FEE_OFFER, fees) == 10);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user