Test
This commit is contained in:
@@ -29,6 +29,8 @@ extern const char *AssetsCCaddr;
|
|||||||
extern char AssetsCChexstr[67];
|
extern char AssetsCChexstr[67];
|
||||||
|
|
||||||
// CCassetsCore
|
// CCassetsCore
|
||||||
|
CC *MakeAssetCond(CPubKey pk);
|
||||||
|
CTxOut MakeAssetsVout(CAmount nValue,CPubKey pk);
|
||||||
CScript EncodeAssetCreateOpRet(uint8_t funcid,std::vector<uint8_t> origpubkey,std::string name,std::string description);
|
CScript EncodeAssetCreateOpRet(uint8_t funcid,std::vector<uint8_t> origpubkey,std::string name,std::string description);
|
||||||
CScript EncodeAssetOpRet(uint8_t funcid,uint256 assetid,uint256 assetid2,uint64_t price,std::vector<uint8_t> origpubkey);
|
CScript EncodeAssetOpRet(uint8_t funcid,uint256 assetid,uint256 assetid2,uint64_t price,std::vector<uint8_t> origpubkey);
|
||||||
uint8_t DecodeAssetOpRet(const CScript &scriptPubKey,uint256 &assetid,uint256 &assetid2,uint64_t &price,std::vector<uint8_t> &origpubkey);
|
uint8_t DecodeAssetOpRet(const CScript &scriptPubKey,uint256 &assetid,uint256 &assetid2,uint64_t &price,std::vector<uint8_t> &origpubkey);
|
||||||
|
|||||||
@@ -15,6 +15,24 @@
|
|||||||
|
|
||||||
#include "CCassets.h"
|
#include "CCassets.h"
|
||||||
|
|
||||||
|
CC *MakeAssetCond(CPubKey pk)
|
||||||
|
{
|
||||||
|
std::vector<CC*> pks; uint8_t evalcode = EVAL_ASSETS;
|
||||||
|
pks.push_back(CCNewSecp256k1(pk));
|
||||||
|
CC *assetCC = CCNewEval(E_MARSHAL(ss << evalcode));
|
||||||
|
CC *Sig = CCNewThreshold(1, pks);
|
||||||
|
return CCNewThreshold(2, {assetCC, Sig});
|
||||||
|
}
|
||||||
|
|
||||||
|
CTxOut MakeAssetsVout(CAmount nValue,CPubKey pk)
|
||||||
|
{
|
||||||
|
CTxOut vout;
|
||||||
|
CC *payoutCond = MakeAssetCond(pk);
|
||||||
|
vout = CTxOut(nValue,CCPubKey(payoutCond));
|
||||||
|
cc_free(payoutCond);
|
||||||
|
return(vout);
|
||||||
|
}
|
||||||
|
|
||||||
CScript EncodeAssetCreateOpRet(uint8_t funcid,std::vector<uint8_t> origpubkey,std::string name,std::string description)
|
CScript EncodeAssetCreateOpRet(uint8_t funcid,std::vector<uint8_t> origpubkey,std::string name,std::string description)
|
||||||
{
|
{
|
||||||
CScript opret; uint8_t evalcode = EVAL_ASSETS;
|
CScript opret; uint8_t evalcode = EVAL_ASSETS;
|
||||||
|
|||||||
Reference in New Issue
Block a user