Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

#include <governance-validators.h>

+ Collaboration diagram for CProposalValidator:

Public Member Functions

 CProposalValidator (const std::string &strDataHexIn=std::string(), bool fAllowLegacyFormat=true)
 
bool Validate (bool fCheckExpiration=true)
 
const std::string & GetErrorMessages ()
 

Private Member Functions

void ParseStrHexData (const std::string &strHexData)
 
void ParseJSONData (const std::string &strJSONData)
 
bool GetDataValue (const std::string &strKey, std::string &strValueRet)
 
bool GetDataValue (const std::string &strKey, int64_t &nValueRet)
 
bool GetDataValue (const std::string &strKey, double &dValueRet)
 
bool ValidateName ()
 
bool ValidateStartEndEpoch (bool fCheckExpiration=true)
 
bool ValidatePaymentAmount ()
 
bool ValidatePaymentAddress ()
 
bool ValidateURL ()
 
bool CheckURL (const std::string &strURLIn)
 

Private Attributes

UniValue objJSON
 
bool fJSONValid
 
bool fAllowLegacyFormat
 
std::string strErrorMessages
 

Detailed Description

Definition at line 12 of file governance-validators.h.

Constructor & Destructor Documentation

◆ CProposalValidator()

CProposalValidator::CProposalValidator ( const std::string &  strDataHexIn = std::string(),
bool  fAllowLegacyFormat = true 
)

Definition at line 17 of file governance-validators.cpp.

References ParseStrHexData().

Member Function Documentation

◆ CheckURL()

bool CProposalValidator::CheckURL ( const std::string &  strURLIn)
private

Definition at line 291 of file governance-validators.cpp.

Referenced by ValidateURL().

◆ GetDataValue() [1/3]

bool CProposalValidator::GetDataValue ( const std::string &  strKey,
std::string &  strValueRet 
)
private

◆ GetDataValue() [2/3]

bool CProposalValidator::GetDataValue ( const std::string &  strKey,
int64_t &  nValueRet 
)
private

◆ GetDataValue() [3/3]

bool CProposalValidator::GetDataValue ( const std::string &  strKey,
double &  dValueRet 
)
private

◆ GetErrorMessages()

const std::string& CProposalValidator::GetErrorMessages ( )
inline

◆ ParseJSONData()

void CProposalValidator::ParseJSONData ( const std::string &  strJSONData)
private

◆ ParseStrHexData()

void CProposalValidator::ParseStrHexData ( const std::string &  strHexData)
private

◆ Validate()

bool CProposalValidator::Validate ( bool  fCheckExpiration = true)

◆ ValidateName()

bool CProposalValidator::ValidateName ( )
private

Definition at line 67 of file governance-validators.cpp.

References GetDataValue(), MAX_NAME_SIZE, strErrorMessages, and strprintf.

Referenced by Validate().

◆ ValidatePaymentAddress()

bool CProposalValidator::ValidatePaymentAddress ( )
private

◆ ValidatePaymentAmount()

bool CProposalValidator::ValidatePaymentAmount ( )
private

Definition at line 120 of file governance-validators.cpp.

References GetDataValue(), and strErrorMessages.

Referenced by Validate().

◆ ValidateStartEndEpoch()

bool CProposalValidator::ValidateStartEndEpoch ( bool  fCheckExpiration = true)
private

Definition at line 92 of file governance-validators.cpp.

References GetAdjustedTime(), GetDataValue(), and strErrorMessages.

Referenced by Validate().

◆ ValidateURL()

bool CProposalValidator::ValidateURL ( )
private

Definition at line 170 of file governance-validators.cpp.

References CheckURL(), GetDataValue(), and strErrorMessages.

Referenced by Validate().

Member Data Documentation

◆ fAllowLegacyFormat

bool CProposalValidator::fAllowLegacyFormat
private

Definition at line 17 of file governance-validators.h.

Referenced by ParseJSONData().

◆ fJSONValid

bool CProposalValidator::fJSONValid
private

Definition at line 16 of file governance-validators.h.

Referenced by ParseJSONData(), and Validate().

◆ objJSON

UniValue CProposalValidator::objJSON
private

Definition at line 15 of file governance-validators.h.

Referenced by GetDataValue(), and ParseJSONData().

◆ strErrorMessages


The documentation for this class was generated from the following files:
Released under the MIT license