mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge TER codes with transaction result metadata codes.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "NewcoinAddress.h"
|
||||
#include "utils.h"
|
||||
#include "NewcoinAddress.h"
|
||||
#include "TransactionErr.h"
|
||||
|
||||
STAmount saZero(CURRENCY_ONE, ACCOUNT_ONE, 0);
|
||||
STAmount saOne(CURRENCY_ONE, ACCOUNT_ONE, 1);
|
||||
@@ -61,11 +62,23 @@ STUInt8* STUInt8::construct(SerializerIterator& u, SField::ref name)
|
||||
|
||||
std::string STUInt8::getText() const
|
||||
{
|
||||
if (getFName() == sfTransactionType)
|
||||
{
|
||||
std::string token, human;
|
||||
if (transResultInfo(static_cast<TER>(value), token, human))
|
||||
return human;
|
||||
}
|
||||
return boost::lexical_cast<std::string>(value);
|
||||
}
|
||||
|
||||
Json::Value STUInt8::getJson(int) const
|
||||
{
|
||||
if (getFName() == sfTransactionType)
|
||||
{
|
||||
std::string token, human;
|
||||
if (transResultInfo(static_cast<TER>(value), token, human))
|
||||
return token;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,14 +100,8 @@ STObject TransactionMetaSet::getAsObject() const
|
||||
|
||||
void TransactionMetaSet::addRaw(Serializer& s, TER result)
|
||||
{
|
||||
mResult = 255;
|
||||
|
||||
if (result == tesSUCCESS)
|
||||
mResult = 0;
|
||||
else if (result == tepPATH_DRY)
|
||||
mResult = 1;
|
||||
else if (result == tepPATH_PARTIAL)
|
||||
mResult = 2;
|
||||
mResult = static_cast<int>(result);
|
||||
assert((mResult == 0) || ((mResult > 100) && (mResult <= 255)));
|
||||
|
||||
mNodes.sort(compare);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user