Make XRPAmount constructor explicit:

Remove the implicit conversion from int64 to XRPAmount. The motivation for this
was noticing that many calls to `to_string` with an integer parameter type were
calling the wrong `to_string` function. Since the calls were not prefixed with
`std::`, and there is no ADL to call `std::to_string`, this was converting the
int to an `XRPAmount` and calling `to_string(XRPAmount)`.

Since `to_string(XRPAmount)` did the same thing as `to_string(int)` this error
went undetected.
This commit is contained in:
seelabs
2019-08-28 11:44:36 -07:00
parent e3b5b808c5
commit 761bb5744e
23 changed files with 87 additions and 77 deletions

View File

@@ -83,7 +83,7 @@ class LedgerRPC_test : public beast::unit_test::suite
// using current identifier
auto const jrr = env.rpc("ledger", "current") [jss::result];
BEAST_EXPECT(jrr[jss::ledger][jss::closed] == false);
BEAST_EXPECT(jrr[jss::ledger][jss::ledger_index] == to_string(env.current()->info().seq));
BEAST_EXPECT(jrr[jss::ledger][jss::ledger_index] == std::to_string(env.current()->info().seq));
BEAST_EXPECT(jrr[jss::ledger_current_index] == env.current()->info().seq);
}
}