Class to handle validations.

This commit is contained in:
JoelKatz
2012-05-03 12:40:54 -07:00
parent 8b58fbd3c4
commit 824f6a14c9
2 changed files with 126 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#ifndef __VALIDATION__
#define __VALIDATION__
#include "SerializedObject.h"
class SerializedValidation : public STObject
{
protected:
STVariableLength mSignature;
public:
typedef boost::shared_ptr<SerializedValidation> pointer;
static SOElement sValidationFormat[16];
static const uint32 sFullFlag;
// These throw if the object is not valid
SerializedValidation(SerializerIterator& sit, bool checkSignature = true);
SerializedValidation(const Serializer& s, bool checkSignature = true);
SerializedValidation(const uint256& ledgerHash, CKey::pointer nodeKey, bool isFull);
uint256 getLedgerHash() const;
NewcoinAddress getSignerPublic() const;
bool isValid() const;
bool isFull() const;
CKey::pointer getSigningKey() const;
uint256 getSigningHash() const;
void addSigned(Serializer&) const;
void addSignature(Serializer&) const;
std::vector<unsigned char> getSigned() const;
std::vector<unsigned char> getSignature() const;
};
#endif