mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 10:35:50 +00:00
Convert macros in STTX.h into an enum
This commit is contained in:
@@ -63,18 +63,18 @@ void Transaction::setStatus (TransStatus ts, std::uint32_t lseq)
|
||||
TransStatus Transaction::sqlTransactionStatus(
|
||||
boost::optional<std::string> const& status)
|
||||
{
|
||||
char const c = (status) ? (*status)[0] : TXN_SQL_UNKNOWN;
|
||||
char const c = (status) ? (*status)[0] : txnSqlUnknown;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case TXN_SQL_NEW: return NEW;
|
||||
case TXN_SQL_CONFLICT: return CONFLICTED;
|
||||
case TXN_SQL_HELD: return HELD;
|
||||
case TXN_SQL_VALIDATED: return COMMITTED;
|
||||
case TXN_SQL_INCLUDED: return INCLUDED;
|
||||
case txnSqlNew: return NEW;
|
||||
case txnSqlConflict: return CONFLICTED;
|
||||
case txnSqlHeld: return HELD;
|
||||
case txnSqlValidated: return COMMITTED;
|
||||
case txnSqlIncluded: return INCLUDED;
|
||||
}
|
||||
|
||||
assert (c == TXN_SQL_UNKNOWN);
|
||||
assert (c == txnSqlUnknown);
|
||||
return INVALID;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,13 +30,15 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
// VFALCO TODO replace these macros with language constants
|
||||
#define TXN_SQL_NEW 'N'
|
||||
#define TXN_SQL_CONFLICT 'C'
|
||||
#define TXN_SQL_HELD 'H'
|
||||
#define TXN_SQL_VALIDATED 'V'
|
||||
#define TXN_SQL_INCLUDED 'I'
|
||||
#define TXN_SQL_UNKNOWN 'U'
|
||||
enum TxnSql : char
|
||||
{
|
||||
txnSqlNew = 'N',
|
||||
txnSqlConflict = 'C',
|
||||
txnSqlHeld = 'H',
|
||||
txnSqlValidated = 'V',
|
||||
txnSqlIncluded = 'I',
|
||||
txnSqlUnknown = 'U'
|
||||
};
|
||||
|
||||
class STTx final
|
||||
: public STObject
|
||||
|
||||
@@ -240,7 +240,7 @@ std::string STTx::getMetaSQL (std::uint32_t inLedger,
|
||||
{
|
||||
Serializer s;
|
||||
add (s);
|
||||
return getMetaSQL (s, inLedger, TXN_SQL_VALIDATED, escapedMetaData);
|
||||
return getMetaSQL (s, inLedger, txnSqlValidated, escapedMetaData);
|
||||
}
|
||||
|
||||
// VFALCO This could be a free function elsewhere
|
||||
|
||||
Reference in New Issue
Block a user