Add unit tests to check synchronization of KnownFormats and gRPC

This commit is contained in:
Scott Schurr
2020-04-14 18:34:12 -07:00
committed by Nik Bougalis
parent dbde686a97
commit 52adcc73d9
7 changed files with 996 additions and 2 deletions

View File

@@ -130,6 +130,19 @@ public:
return itr->second;
}
// begin() and end() are provided for testing purposes.
typename std::forward_list<Item>::const_iterator
begin() const
{
return formats_.begin();
}
typename std::forward_list<Item>::const_iterator
end() const
{
return formats_.end();
}
protected:
/** Retrieve a format based on its name.
*/

View File

@@ -37,6 +37,20 @@ InnerObjectFormats::InnerObjectFormats()
{sfSigningPubKey, soeREQUIRED},
{sfTxnSignature, soeREQUIRED},
});
add(sfMajority.jsonName.c_str(),
sfMajority.getCode(),
{
{sfAmendment, soeREQUIRED},
{sfCloseTime, soeREQUIRED},
});
add(sfDisabledValidator.jsonName.c_str(),
sfDisabledValidator.getCode(),
{
{sfPublicKey, soeREQUIRED},
{sfFirstLedgerSequence, soeREQUIRED},
});
}
InnerObjectFormats const&