rippled
|
Helper for writing unit tests with controlled ledger histories. More...
Public Member Functions | |
LedgerHistoryHelper () | |
Ledger const & | operator[] (std::string const &s) |
Get or create the ledger with the given string history. More... | |
Public Attributes | |
LedgerOracle | oracle |
Tx::ID | nextTx {0} |
std::unordered_map< std::string, Ledger > | ledgers |
std::set< char > | seen |
Helper for writing unit tests with controlled ledger histories.
This class allows clients to refer to distinct ledgers as strings, where each character in the string indicates a unique ledger. It enforces the uniqueness at runtime, but this simplifies creation of alternate ledger histories, e.g.
HistoryHelper hh; hh["a"] hh["ab"] hh["ac"] hh["abd"]
Creates a history like b - d / a - c
ripple::test::csf::LedgerHistoryHelper::LedgerHistoryHelper | ( | ) |
Ledger const& ripple::test::csf::LedgerHistoryHelper::operator[] | ( | std::string const & | s | ) |
LedgerOracle ripple::test::csf::LedgerHistoryHelper::oracle |
std::unordered_map<std::string, Ledger> ripple::test::csf::LedgerHistoryHelper::ledgers |