mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Moved cpp code to src/cpp and js code to src/js.
This commit is contained in:
52
src/cpp/ripple/SerializedValidation.h
Normal file
52
src/cpp/ripple/SerializedValidation.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef __VALIDATION__
|
||||
#define __VALIDATION__
|
||||
|
||||
#include "SerializedObject.h"
|
||||
#include "RippleAddress.h"
|
||||
#include "InstanceCounter.h"
|
||||
|
||||
DEFINE_INSTANCE(SerializedValidation);
|
||||
|
||||
class SerializedValidation : public STObject, private IS_INSTANCE(SerializedValidation)
|
||||
{
|
||||
protected:
|
||||
uint256 mPreviousHash;
|
||||
uint160 mNodeID;
|
||||
bool mTrusted;
|
||||
|
||||
void setNode();
|
||||
|
||||
public:
|
||||
typedef boost::shared_ptr<SerializedValidation> pointer;
|
||||
typedef const boost::shared_ptr<SerializedValidation>& ref;
|
||||
|
||||
static const uint32 sFullFlag;
|
||||
|
||||
// These throw if the object is not valid
|
||||
SerializedValidation(SerializerIterator& sit, bool checkSignature = true);
|
||||
SerializedValidation(const uint256& ledgerHash, uint32 signTime, const RippleAddress& naPub,
|
||||
const RippleAddress& naPriv, bool isFull, uint256& signingHash);
|
||||
|
||||
uint256 getLedgerHash() const;
|
||||
uint32 getSignTime() const;
|
||||
uint32 getFlags() const;
|
||||
RippleAddress getSignerPublic() const;
|
||||
uint160 getNodeID() const { return mNodeID; }
|
||||
bool isValid() const;
|
||||
bool isFull() const;
|
||||
bool isTrusted() const { return mTrusted; }
|
||||
uint256 getSigningHash() const;
|
||||
bool isValid(const uint256&) const;
|
||||
|
||||
void setTrusted() { mTrusted = true; }
|
||||
std::vector<unsigned char> getSigned() const;
|
||||
std::vector<unsigned char> getSignature() const;
|
||||
|
||||
// The validation this replaced
|
||||
const uint256& getPreviousHash() { return mPreviousHash; }
|
||||
bool isPreviousHash(const uint256& h) { return mPreviousHash == h; }
|
||||
void setPreviousHash(const uint256& h) { mPreviousHash = h; }
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim:ts=4
|
||||
Reference in New Issue
Block a user