Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

governance-validators.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2019 The Dash Core developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef GOVERNANCE_VALIDATORS_H
6 #define GOVERNANCE_VALIDATORS_H
7 
8 #include <string>
9 
10 #include <univalue.h>
11 
13 {
14 private:
16  bool fJSONValid;
18  std::string strErrorMessages;
19 
20 public:
21  CProposalValidator(const std::string& strDataHexIn = std::string(), bool fAllowLegacyFormat = true);
22 
23  bool Validate(bool fCheckExpiration = true);
24 
25  const std::string& GetErrorMessages()
26  {
27  return strErrorMessages;
28  }
29 
30 private:
31  void ParseStrHexData(const std::string& strHexData);
32  void ParseJSONData(const std::string& strJSONData);
33 
34  bool GetDataValue(const std::string& strKey, std::string& strValueRet);
35  bool GetDataValue(const std::string& strKey, int64_t& nValueRet);
36  bool GetDataValue(const std::string& strKey, double& dValueRet);
37 
38  bool ValidateName();
39  bool ValidateStartEndEpoch(bool fCheckExpiration = true);
40  bool ValidatePaymentAmount();
42  bool ValidateURL();
43 
44  bool CheckURL(const std::string& strURLIn);
45 };
46 
47 #endif
void ParseStrHexData(const std::string &strHexData)
bool CheckURL(const std::string &strURLIn)
void ParseJSONData(const std::string &strJSONData)
const std::string & GetErrorMessages()
bool Validate(bool fCheckExpiration=true)
CProposalValidator(const std::string &strDataHexIn=std::string(), bool fAllowLegacyFormat=true)
bool ValidateStartEndEpoch(bool fCheckExpiration=true)
bool GetDataValue(const std::string &strKey, std::string &strValueRet)
Released under the MIT license