Browse Source

Test

metaverse
jl777 5 years ago
parent
commit
b711cfaee3
  1. 5
      src/cc/dilithium.c
  2. 8
      src/cc/rogue_rpc.cpp

5
src/cc/dilithium.c

@ -3231,8 +3231,11 @@ UniValue dilithium_spend(uint64_t txfee,struct CCcontract_info *cp,cJSON *params
bool dilithium_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx)
{
CPubKey destpub33; std::string handle; uint256 hashBlock,destpubtxid,checktxid; CTransaction vintx; int32_t numvouts,mlen,smlen=CRYPTO_BYTES+32; std::vector<uint8_t> sig; uint8_t msg[32],msg2[CRYPTO_BYTES+32],pk[CRYPTO_PUBLICKEYBYTES];
CPubKey destpub33; std::string handle; uint256 hashBlock,destpubtxid,checktxid; CTransaction vintx; int32_t numvouts,numvins,mlen,smlen=CRYPTO_BYTES+32; std::vector<uint8_t> sig; uint8_t msg[32],msg2[CRYPTO_BYTES+32],pk[CRYPTO_PUBLICKEYBYTES];
// if all dilithium tx -> do multispend/send, else:
numvouts = tx.vout.size();
numvins = tx.vin.size();
if ( tx.vout.size() != 2 )
return eval->Invalid("numvouts != 2");
else if ( tx.vin.size() != 1 )

8
src/cc/rogue_rpc.cpp

@ -1330,7 +1330,7 @@ UniValue rogue_setname(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx)
{
CScript scriptPubKey; std::vector<uint8_t> vopret; uint8_t *script,e,f,funcid; int32_t i,maxplayers,decoded=0,regslot,ind,err,dispflag,gameheight,score,numvouts; CTransaction vintx,gametx; CPubKey pk; uint256 hashBlock,gametxid,txid,tokenid,batontxid,playertxid,ptxid; int64_t buyin,cashout; std::vector<uint8_t> playerdata,keystrokes; std::string symbol,pname;
CScript scriptPubKey; std::vector<uint8_t> vopret; uint8_t *script,e,f,funcid,tokentx=0; int32_t i,maxplayers,decoded=0,regslot,ind,err,dispflag,gameheight,score,numvouts; CTransaction vintx,gametx; CPubKey pk; uint256 hashBlock,gametxid,txid,tokenid,batontxid,playertxid,ptxid; int64_t buyin,cashout; std::vector<uint8_t> playerdata,keystrokes; std::string symbol,pname;
if ( strcmp(ASSETCHAINS_SYMBOL,"ROGUE") == 0 && height < 21274 )
return(true);
if ( (numvouts= tx.vout.size()) > 1 )
@ -1344,6 +1344,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C
funcid = script[1];
if ( (e= script[0]) == EVAL_TOKENS )
{
tokentx = 1;
if ( (funcid= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) == 0 )
{
if ( (funcid= rogue_registeropretdecode(gametxid,tokenid,playertxid,scriptPubKey)) == 0 )
@ -1408,13 +1409,14 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C
}
else // this is asset transaction, which means playerdata txid already confirmed
{
switch ( funcid )
fprintf(stderr,"ht.%d tokentx.%d funcid.(%c)\n",height,tokentx,funcid);
/*switch ( funcid )
{
case 'H': // win
case 'Q': // bailout
return(true);
break;
}
}*/
}
switch ( funcid )
{

Loading…
Cancel
Save