mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 14:05:51 +00:00
Use macros to instantiate most SField instances:
There have been cases in the past where SFields have been defined in such a way that they did not follow our conventions. In particular, the string representation of an SField should match the in-code name of the SField. This change leverages the preprocessor to encourage SFields to be properly constructed. The suffixes of SField types are changed to be the same as the suffixes of corresponding SerializedTypeIDs. This allows The preprocessor to match types using simple name pasting. Since the string representation of the SField is part of our stable API, the name of sfPayChannel was changed to sfChannel. This change allows sfChannel to follow our conventions while making no changes to our external API.
This commit is contained in:
committed by
Nik Bougalis
parent
f239050054
commit
17abca1caa
@@ -56,7 +56,7 @@ void
|
||||
populateProtoVLasString(
|
||||
T const& getProto,
|
||||
STObject const& from,
|
||||
SF_Blob const& field)
|
||||
SF_VL const& field)
|
||||
{
|
||||
if (from.isFieldPresent(field))
|
||||
{
|
||||
@@ -71,7 +71,7 @@ void
|
||||
populateProtoVec256(
|
||||
T const& getProto,
|
||||
STObject const& from,
|
||||
SF_Vec256 const& field)
|
||||
SF_VECTOR256 const& field)
|
||||
{
|
||||
if (from.isFieldPresent(field))
|
||||
{
|
||||
@@ -89,7 +89,7 @@ void
|
||||
populateProtoAccount(
|
||||
T const& getProto,
|
||||
STObject const& from,
|
||||
SF_Account const& field)
|
||||
SF_ACCOUNT const& field)
|
||||
{
|
||||
if (from.isFieldPresent(field))
|
||||
{
|
||||
@@ -103,7 +103,7 @@ void
|
||||
populateProtoAmount(
|
||||
T const& getProto,
|
||||
STObject const& from,
|
||||
SF_Amount const& field)
|
||||
SF_AMOUNT const& field)
|
||||
{
|
||||
if (from.isFieldPresent(field))
|
||||
{
|
||||
@@ -117,7 +117,7 @@ void
|
||||
populateProtoCurrency(
|
||||
T const& getProto,
|
||||
STObject const& from,
|
||||
SF_U160 const& field)
|
||||
SF_HASH160 const& field)
|
||||
{
|
||||
if (from.isFieldPresent(field))
|
||||
{
|
||||
@@ -364,7 +364,7 @@ void
|
||||
populateChannel(T& to, STObject const& from)
|
||||
{
|
||||
populateProtoPrimitive(
|
||||
[&to]() { return to.mutable_channel(); }, from, sfPayChannel);
|
||||
[&to]() { return to.mutable_channel(); }, from, sfChannel);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
||||
Reference in New Issue
Block a user