diff --git a/src/SerializedObject.cpp b/src/SerializedObject.cpp index 123781cbef..8f465936f6 100644 --- a/src/SerializedObject.cpp +++ b/src/SerializedObject.cpp @@ -485,6 +485,17 @@ STAmount STObject::getValueFieldAmount(SOE_Field field) const return *cf; } +STPathSet STObject::getValueFieldPathSet(SOE_Field field) const +{ + const SerializedType* rf = peekAtPField(field); + if (!rf) throw std::runtime_error("Field not found"); + SerializedTypeID id = rf->getSType(); + if (id == STI_NOTPRESENT) return STPathSet(); // optional field not present + const STPathSet *cf = dynamic_cast(rf); + if (!cf) throw std::runtime_error("Wrong field type"); + return *cf; +} + STVector256 STObject::getValueFieldV256(SOE_Field field) const { const SerializedType* rf = peekAtPField(field); diff --git a/src/SerializedObject.h b/src/SerializedObject.h index 3c322486da..10759c84c2 100644 --- a/src/SerializedObject.h +++ b/src/SerializedObject.h @@ -166,6 +166,7 @@ public: std::vector getValueFieldVL(SOE_Field field) const; std::vector getValueFieldTL(SOE_Field field) const; STAmount getValueFieldAmount(SOE_Field field) const; + STPathSet getValueFieldPathSet(SOE_Field field) const; STVector256 getValueFieldV256(SOE_Field field) const; void setValueFieldU8(SOE_Field field, unsigned char); diff --git a/src/SerializedTransaction.h b/src/SerializedTransaction.h index 2ec1bced89..59f1650ca1 100644 --- a/src/SerializedTransaction.h +++ b/src/SerializedTransaction.h @@ -89,6 +89,7 @@ public: std::vector getITFieldVL(SOE_Field field) const { return mInnerTxn.getValueFieldVL(field); } std::vector getITFieldTL(SOE_Field field) const { return mInnerTxn.getValueFieldTL(field); } STAmount getITFieldAmount(SOE_Field field) const { return mInnerTxn.getValueFieldAmount(field); } + STPathSet getITFieldPathSet(SOE_Field field) const { return mInnerTxn.getValueFieldPathSet(field); } void setITFieldU8(SOE_Field field, unsigned char v) { return mInnerTxn.setValueFieldU8(field, v); } void setITFieldU16(SOE_Field field, uint16 v) { return mInnerTxn.setValueFieldU16(field, v); }