diff --git a/src/SerializedTypes.cpp b/src/SerializedTypes.cpp index 3f9f5c9b6..96b9e7301 100644 --- a/src/SerializedTypes.cpp +++ b/src/SerializedTypes.cpp @@ -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(value), token, human)) + return human; + } return boost::lexical_cast(value); } Json::Value STUInt8::getJson(int) const { + if (getFName() == sfTransactionType) + { + std::string token, human; + if (transResultInfo(static_cast(value), token, human)) + return token; + } return value; } diff --git a/src/TransactionMeta.cpp b/src/TransactionMeta.cpp index 213542dd0..30117e1e7 100644 --- a/src/TransactionMeta.cpp +++ b/src/TransactionMeta.cpp @@ -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(result); + assert((mResult == 0) || ((mResult > 100) && (mResult <= 255))); mNodes.sort(compare);