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