Use Rate to represent transfer rates (RIPD-201, RIPD-983):

The Ripple protocol represent transfer rates and trust line
qualities as fractions of one billion. For example, a transfer
rate of 1% is represented as 1010000000.

Previously, such rates where represented either as std::uint32_t
or std::uint64_t. Other, nominally related types, also used an
integral representation and could be unintentionally substituted.

The new Rate class addresses this by providing a simple, type
safe alternative which also helps make the code self-documenting
since arithmetic operations now can be clearly understood to
involve the scaling of an amount by a rate.
This commit is contained in:
Nik Bougalis
2016-06-08 03:07:19 -07:00
committed by Miguel Portilla
parent f060820f3b
commit a698104c55
34 changed files with 579 additions and 433 deletions

View File

@@ -38,6 +38,7 @@
#include <ripple/app/paths/cursor/AdvanceNode.cpp>
#include <ripple/app/paths/cursor/DeliverNodeForward.cpp>
#include <ripple/app/paths/cursor/DeliverNodeReverse.cpp>
#include <ripple/app/paths/cursor/EffectiveRate.cpp>
#include <ripple/app/paths/cursor/ForwardLiquidity.cpp>
#include <ripple/app/paths/cursor/ForwardLiquidityForAccount.cpp>
#include <ripple/app/paths/cursor/Liquidity.cpp>