Add units to all fee calculations:

* Uses existing XRPAmount with units for drops, and a new TaggedFee for
  fee units (LoadFeeTrack), and fee levels (TxQ).
* Resolves #2451
This commit is contained in:
Edward Hennis
2019-02-14 18:59:07 -05:00
parent 1901b981f3
commit e3b5b808c5
87 changed files with 2195 additions and 681 deletions

View File

@@ -55,14 +55,26 @@ STValidation::STValidation(
if (fees.loadFee)
setFieldU32(sfLoadFee, *fees.loadFee);
// IF any of the values are out of the valid range, don't send a value.
// They should not be an issue, though, because the voting
// process (FeeVoteImpl) ignores any out of range values.
if (fees.baseFee)
setFieldU64(sfBaseFee, *fees.baseFee);
{
if (auto const v = fees.baseFee->dropsAs<std::uint64_t>())
setFieldU64(sfBaseFee, *v);
}
if (fees.reserveBase)
setFieldU32(sfReserveBase, *fees.reserveBase);
{
if (auto const v = fees.reserveBase->dropsAs<std::uint32_t>())
setFieldU32(sfReserveBase, *v);
}
if (fees.reserveIncrement)
setFieldU32(sfReserveIncrement, *fees.reserveIncrement);
{
if (auto const v = fees.reserveIncrement->dropsAs<std::uint32_t>())
setFieldU32(sfReserveIncrement, *v);
}
if (!amendments.empty())
setFieldV256(sfAmendments, STVector256(sfAmendments, amendments));