Test opret validation

This commit is contained in:
jl777
2019-02-18 01:20:28 -11:00
parent a30ed1916f
commit 54319f4bb6

View File

@@ -1219,7 +1219,6 @@ 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,errflag,dispflag,score,numvouts; CTransaction vintx; CPubKey pk; uint256 hashBlock,gametxid,tokenid,batontxid,playertxid; int64_t buyin; std::vector<uint8_t> playerdata,keystrokes; std::string symbol,pname;
return(true);
if ( (numvouts= tx.vout.size()) > 1 )
{
scriptPubKey = tx.vout[numvouts-1].scriptPubKey;
@@ -1254,6 +1253,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C
case 'R':
if ( (funcid= rogue_registeropretdecode(gametxid,tokenid,playertxid,scriptPubKey)) != 'R' )
return eval->Invalid("couldnt decode register opret");
// validation is done below
break;
case 'K':
if ( (funcid= rogue_keystrokesopretdecode(gametxid,batontxid,pk,keystrokes,scriptPubKey)) != 'K' )
@@ -1264,6 +1264,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C
case 'H': case 'Q':
if ( (f= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) != funcid )
return eval->Invalid("couldnt decode H/Q opret");
// validation is done below
break;
default:
return eval->Invalid("illegal rogue non-decoded funcid");