Reduce STAmount public interface (RIPD-867):

* Implement subtraction as addition to the additive inverse
* Do not allow comparison with, addition to or subtraction from integers
* Remove unused functions
* Convert member functions to free functions
* Isolate unit-test specific code into the unit test
This commit is contained in:
Nik Bougalis
2015-05-17 10:29:47 -07:00
parent 67b18e4bea
commit 6f5d8bba2d
19 changed files with 351 additions and 541 deletions

View File

@@ -45,7 +45,7 @@ void addLine (Json::Value& jsonLines, RippleState const& line)
// Amount reported is negative if other account holds current
// account's IOUs.
jPeer[jss::balance] = saBalance.getText ();
jPeer[jss::currency] = saBalance.getHumanCurrency ();
jPeer[jss::currency] = to_string (saBalance.issue ().currency);
jPeer[jss::limit] = saLimit.getText ();
jPeer[jss::limit_peer] = saLimitPeer.getText ();
jPeer[jss::quality_in]

View File

@@ -400,7 +400,7 @@ static Json::Value checkPayment(
saSendMax.setIssuer (raSrcAddressID.getAccountID ());
}
if (saSendMax.isNative () && amount.isNative ())
if (saSendMax.native () && amount.native ())
return RPC::make_error (rpcINVALID_PARAMS,
"Cannot build XRP to XRP paths.");
@@ -486,7 +486,7 @@ checkTxJsonFields (
// Check for current ledger.
if (verify && !getConfig ().RUN_STANDALONE &&
(apiFacade.getValidatedLedgerAge() >
(apiFacade.getValidatedLedgerAge() >
Tuning::maxValidatedLedgerAge))
{
ret.first = rpcError (rpcNO_CURRENT);