CC_info
This commit is contained in:
@@ -47,11 +47,11 @@ public:
|
|||||||
return CTxOut(amount, CScript() << ParseHex(HexStr(myPubkey)) << OP_CHECKSIG);
|
return CTxOut(amount, CScript() << ParseHex(HexStr(myPubkey)) << OP_CHECKSIG);
|
||||||
} */
|
} */
|
||||||
static bool GetCoinsOrTokensCCaddress1of2(char *coinaddr, CPubKey ownerPubkey, CPubKey heirPubkey) {
|
static bool GetCoinsOrTokensCCaddress1of2(char *coinaddr, CPubKey ownerPubkey, CPubKey heirPubkey) {
|
||||||
struct CCcontract_info *cpHeir, heirC;
|
struct CC_info *cpHeir, heirC;
|
||||||
cpHeir = CCinit(&heirC, EVAL_HEIR);
|
cpHeir = CCinit(&heirC, EVAL_HEIR);
|
||||||
return GetCCaddress1of2(cpHeir, coinaddr, ownerPubkey, heirPubkey);
|
return GetCCaddress1of2(cpHeir, coinaddr, ownerPubkey, heirPubkey);
|
||||||
}
|
}
|
||||||
static void CCaddrCoinsOrTokens1of2set(struct CCcontract_info *cp, CPubKey ownerPubkey, CPubKey heirPubkey, char *coinaddr) {
|
static void CCaddrCoinsOrTokens1of2set(struct CC_info *cp, CPubKey ownerPubkey, CPubKey heirPubkey, char *coinaddr) {
|
||||||
CCaddr1of2set(cp, ownerPubkey, heirPubkey, coinaddr);
|
CCaddr1of2set(cp, ownerPubkey, heirPubkey, coinaddr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -61,7 +61,7 @@ class TokenHelper {
|
|||||||
public:
|
public:
|
||||||
static uint8_t getMyEval() { return EVAL_TOKENS; }
|
static uint8_t getMyEval() { return EVAL_TOKENS; }
|
||||||
static int64_t addOwnerInputs(uint256 tokenid, CMutableTransaction& mtx, CPubKey ownerPubkey, int64_t total, int32_t maxinputs) {
|
static int64_t addOwnerInputs(uint256 tokenid, CMutableTransaction& mtx, CPubKey ownerPubkey, int64_t total, int32_t maxinputs) {
|
||||||
struct CCcontract_info *cpHeir, heirC;
|
struct CC_info *cpHeir, heirC;
|
||||||
cpHeir = CCinit(&heirC, EVAL_TOKENS);
|
cpHeir = CCinit(&heirC, EVAL_TOKENS);
|
||||||
return AddTokenCCInputs(cpHeir, mtx, ownerPubkey, tokenid, total, maxinputs);
|
return AddTokenCCInputs(cpHeir, mtx, ownerPubkey, tokenid, total, maxinputs);
|
||||||
}
|
}
|
||||||
@@ -89,12 +89,12 @@ public:
|
|||||||
return MakeCC1vout(EVAL_TOKENS, amount, myPubkey); // yes EVAL_TOKENS
|
return MakeCC1vout(EVAL_TOKENS, amount, myPubkey); // yes EVAL_TOKENS
|
||||||
} */
|
} */
|
||||||
static bool GetCoinsOrTokensCCaddress1of2(char *coinaddr, CPubKey ownerPubkey, CPubKey heirPubkey) {
|
static bool GetCoinsOrTokensCCaddress1of2(char *coinaddr, CPubKey ownerPubkey, CPubKey heirPubkey) {
|
||||||
struct CCcontract_info *cpHeir, heirC;
|
struct CC_info *cpHeir, heirC;
|
||||||
cpHeir = CCinit(&heirC, EVAL_HEIR);
|
cpHeir = CCinit(&heirC, EVAL_HEIR);
|
||||||
return GetTokensCCaddress1of2(cpHeir, coinaddr, ownerPubkey, heirPubkey);
|
return GetTokensCCaddress1of2(cpHeir, coinaddr, ownerPubkey, heirPubkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CCaddrCoinsOrTokens1of2set(struct CCcontract_info *cp, CPubKey ownerPubkey, CPubKey heirPubkey, char *coinaddr) {
|
static void CCaddrCoinsOrTokens1of2set(struct CC_info *cp, CPubKey ownerPubkey, CPubKey heirPubkey, char *coinaddr) {
|
||||||
|
|
||||||
CCaddrTokens1of2set(cp, ownerPubkey, heirPubkey, coinaddr);
|
CCaddrTokens1of2set(cp, ownerPubkey, heirPubkey, coinaddr);
|
||||||
}
|
}
|
||||||
@@ -123,13 +123,13 @@ public:
|
|||||||
class CValidatorBase
|
class CValidatorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CValidatorBase(CCcontract_info* cp) : m_cp(cp) {}
|
CValidatorBase(CC_info* cp) : m_cp(cp) {}
|
||||||
virtual bool isVinValidator() const = 0;
|
virtual bool isVinValidator() const = 0;
|
||||||
virtual bool validateVin(CTxIn vin, CTxOut prevVout, std::string& message) const = 0;
|
virtual bool validateVin(CTxIn vin, CTxOut prevVout, std::string& message) const = 0;
|
||||||
virtual bool validateVout(CTxOut vout, std::string& message) const = 0;
|
virtual bool validateVout(CTxOut vout, std::string& message) const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CCcontract_info * m_cp;
|
CC_info * m_cp;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,11 +138,11 @@ protected:
|
|||||||
class CInputIdentifierBase
|
class CInputIdentifierBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CInputIdentifierBase(CCcontract_info* cp) : m_cp(cp) {}
|
CInputIdentifierBase(CC_info* cp) : m_cp(cp) {}
|
||||||
virtual std::string inputName() const = 0;
|
virtual std::string inputName() const = 0;
|
||||||
virtual bool identifyInput(CTxIn vin) const = 0;
|
virtual bool identifyInput(CTxIn vin) const = 0;
|
||||||
protected:
|
protected:
|
||||||
CCcontract_info * m_cp;
|
CC_info * m_cp;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -375,7 +375,7 @@ private:
|
|||||||
|
|
||||||
class CNormalInputIdentifier : CInputIdentifierBase {
|
class CNormalInputIdentifier : CInputIdentifierBase {
|
||||||
public:
|
public:
|
||||||
CNormalInputIdentifier(CCcontract_info* cp) : CInputIdentifierBase(cp) {}
|
CNormalInputIdentifier(CC_info* cp) : CInputIdentifierBase(cp) {}
|
||||||
virtual std::string inputName() const { return std::string("normal input"); }
|
virtual std::string inputName() const { return std::string("normal input"); }
|
||||||
virtual bool identifyInput(CTxIn vin) const {
|
virtual bool identifyInput(CTxIn vin) const {
|
||||||
return !IsCCInput(vin.scriptSig);
|
return !IsCCInput(vin.scriptSig);
|
||||||
@@ -384,7 +384,7 @@ public:
|
|||||||
|
|
||||||
class CCCInputIdentifier : CInputIdentifierBase {
|
class CCCInputIdentifier : CInputIdentifierBase {
|
||||||
public:
|
public:
|
||||||
CCCInputIdentifier(CCcontract_info* cp) : CInputIdentifierBase(cp) {}
|
CCCInputIdentifier(CC_info* cp) : CInputIdentifierBase(cp) {}
|
||||||
virtual std::string inputName() const { return std::string("CC input"); }
|
virtual std::string inputName() const { return std::string("CC input"); }
|
||||||
virtual bool identifyInput(CTxIn vin) const {
|
virtual bool identifyInput(CTxIn vin) const {
|
||||||
return IsCCInput(vin.scriptSig);
|
return IsCCInput(vin.scriptSig);
|
||||||
@@ -398,7 +398,7 @@ public:
|
|||||||
template <class Helper> class CCC1of2AddressValidator : CValidatorBase
|
template <class Helper> class CCC1of2AddressValidator : CValidatorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CCC1of2AddressValidator(CCcontract_info* cp, CScript opRetScript, std::string customMessage = "") :
|
CCC1of2AddressValidator(CC_info* cp, CScript opRetScript, std::string customMessage = "") :
|
||||||
m_fundingOpretScript(opRetScript), m_customMessage(customMessage), CValidatorBase(cp) {}
|
m_fundingOpretScript(opRetScript), m_customMessage(customMessage), CValidatorBase(cp) {}
|
||||||
|
|
||||||
virtual bool isVinValidator() const { return false; }
|
virtual bool isVinValidator() const { return false; }
|
||||||
@@ -452,7 +452,7 @@ private:
|
|||||||
template <class Helper> class CMyPubkeyVoutValidator : CValidatorBase
|
template <class Helper> class CMyPubkeyVoutValidator : CValidatorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMyPubkeyVoutValidator(CCcontract_info* cp, CScript opRetScript, bool checkNormals)
|
CMyPubkeyVoutValidator(CC_info* cp, CScript opRetScript, bool checkNormals)
|
||||||
: m_fundingOpretScript(opRetScript), m_checkNormals(checkNormals), CValidatorBase(cp) { }
|
: m_fundingOpretScript(opRetScript), m_checkNormals(checkNormals), CValidatorBase(cp) { }
|
||||||
|
|
||||||
virtual bool isVinValidator() const { return false; }
|
virtual bool isVinValidator() const { return false; }
|
||||||
@@ -512,7 +512,7 @@ private:
|
|||||||
template <class Helper> class CHeirSpendValidator : CValidatorBase
|
template <class Helper> class CHeirSpendValidator : CValidatorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CHeirSpendValidator(CCcontract_info* cp, CScript opRetScript, uint256 latesttxid, uint8_t isHeirSpendingBegan)
|
CHeirSpendValidator(CC_info* cp, CScript opRetScript, uint256 latesttxid, uint8_t isHeirSpendingBegan)
|
||||||
: m_fundingOpretScript(opRetScript), m_latesttxid(latesttxid), m_isHeirSpendingBegan(isHeirSpendingBegan), CValidatorBase(cp) {}
|
: m_fundingOpretScript(opRetScript), m_latesttxid(latesttxid), m_isHeirSpendingBegan(isHeirSpendingBegan), CValidatorBase(cp) {}
|
||||||
|
|
||||||
virtual bool isVinValidator() const { return false; }
|
virtual bool isVinValidator() const { return false; }
|
||||||
@@ -568,7 +568,7 @@ private:
|
|||||||
template <class Helper> class COpRetValidator : CValidatorBase
|
template <class Helper> class COpRetValidator : CValidatorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
COpRetValidator(CCcontract_info* cp, CScript opret)
|
COpRetValidator(CC_info* cp, CScript opret)
|
||||||
: m_fundingOpretScript(opret), CValidatorBase(cp) {}
|
: m_fundingOpretScript(opret), CValidatorBase(cp) {}
|
||||||
|
|
||||||
virtual bool isVinValidator() const { return false; }
|
virtual bool isVinValidator() const { return false; }
|
||||||
@@ -619,7 +619,7 @@ private:
|
|||||||
template <class Helper> class CNullValidator : CValidatorBase
|
template <class Helper> class CNullValidator : CValidatorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CNullValidator(CCcontract_info* cp)
|
CNullValidator(CC_info* cp)
|
||||||
: CValidatorBase(cp) { }
|
: CValidatorBase(cp) { }
|
||||||
|
|
||||||
virtual bool isVinValidator() const { return false; }
|
virtual bool isVinValidator() const { return false; }
|
||||||
|
|||||||
Reference in New Issue
Block a user