mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
More serialization work.
This commit is contained in:
@@ -4,24 +4,28 @@
|
||||
#include "HashPrefixes.h"
|
||||
|
||||
SOElement SerializedValidation::sValidationFormat[] = {
|
||||
{ sfFlags, "Flags", STI_UINT32, SOE_FLAGS, 0 },
|
||||
{ sfLedgerHash, "LedgerHash", STI_HASH256, SOE_REQUIRED, 0 },
|
||||
{ sfSigningTime, "SignTime", STI_UINT32, SOE_REQUIRED, 0 },
|
||||
{ sfSigningKey, "SigningKey", STI_VL, SOE_REQUIRED, 0 },
|
||||
{ sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 },
|
||||
{ sfFlags, SOE_REQUIRED },
|
||||
{ sfLedgerHash, SOE_REQUIRED },
|
||||
{ sfLedgerSequence, SOE_OPTIONAL },
|
||||
{ sfCloseTime, SOE_OPTIONAL },
|
||||
{ sfLoadFee, SOE_OPTIONAL },
|
||||
{ sfBaseFee, SOE_OPTIONAL },
|
||||
{ sfSigningTime, SOE_REQUIRED },
|
||||
{ sfSigningKey, SOE_REQUIRED },
|
||||
{ sfInvalid, SOE_END }
|
||||
};
|
||||
|
||||
const uint32 SerializedValidation::sFullFlag = 0x00010000;
|
||||
|
||||
SerializedValidation::SerializedValidation(SerializerIterator& sit, bool checkSignature)
|
||||
: STObject(sValidationFormat, sit), mSignature(sit, "Signature"), mTrusted(false)
|
||||
: STObject(sValidationFormat, sit, sfValidation), mSignature(sit, sfSignature), mTrusted(false)
|
||||
{
|
||||
if (checkSignature && !isValid()) throw std::runtime_error("Invalid validation");
|
||||
}
|
||||
|
||||
SerializedValidation::SerializedValidation(const uint256& ledgerHash, uint32 signTime,
|
||||
const NewcoinAddress& naSeed, bool isFull)
|
||||
: STObject(sValidationFormat), mSignature("Signature"), mTrusted(false)
|
||||
: STObject(sValidationFormat, sfValidation), mSignature(sfSignature), mTrusted(false)
|
||||
{
|
||||
setValueFieldH256(sfLedgerHash, ledgerHash);
|
||||
setValueFieldU32(sfSigningTime, signTime);
|
||||
|
||||
Reference in New Issue
Block a user