Test
This commit is contained in:
@@ -458,7 +458,7 @@ int64_t AssetValidateCCvin(struct CCcontract_info *cp,Eval* eval,char *origCCadd
|
||||
else if( GetAssetorigaddrs(cp, origCCaddr, origaddr, vinTx) == 0 )
|
||||
return eval->Invalid("couldnt get origaddr for buyvin");
|
||||
|
||||
fprintf(stderr,"AssetValidateCCvin() got %.8f to origaddr.(%s)\n", (double)vinTx.vout[tx.vin[vini].prevout.n].nValue/COIN,origaddr);
|
||||
//fprintf(stderr,"AssetValidateCCvin() got %.8f to origaddr.(%s)\n", (double)vinTx.vout[tx.vin[vini].prevout.n].nValue/COIN,origaddr);
|
||||
|
||||
if ( vinTx.vout[0].nValue == 0 )
|
||||
return eval->Invalid("null value CCvin");
|
||||
@@ -622,7 +622,7 @@ bool AssetCalcAmounts(struct CCcontract_info *cpAssets, int64_t &inputs, int64_t
|
||||
assetoshis = IsTokensvout(false, false, cpTokens, NULL, vinTx, tx.vin[i].prevout.n, assetid);
|
||||
if (assetoshis != 0)
|
||||
{
|
||||
std::cerr << "AssetCalcAmounts() vin i=" << i << " assetoshis=" << assetoshis << std::endl;
|
||||
//std::cerr << "AssetCalcAmounts() vin i=" << i << " assetoshis=" << assetoshis << std::endl;
|
||||
inputs += assetoshis;
|
||||
}
|
||||
}
|
||||
@@ -634,7 +634,7 @@ bool AssetCalcAmounts(struct CCcontract_info *cpAssets, int64_t &inputs, int64_t
|
||||
assetoshis = IsAssetvout(cpAssets, tmpprice, tmporigpubkey, tx, i, assetid);
|
||||
if (assetoshis != 0)
|
||||
{
|
||||
std::cerr << "AssetCalcAmounts() vout i=" << i << " assetoshis=" << assetoshis << std::endl;
|
||||
//std::cerr << "AssetCalcAmounts() vout i=" << i << " assetoshis=" << assetoshis << std::endl;
|
||||
outputs += assetoshis;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ bool AssetsValidate(struct CCcontract_info *cpAssets,Eval* eval,const CTransacti
|
||||
return eval->Invalid("mismatched vout0 assets dual unspendable CCaddr for fill sell");
|
||||
}
|
||||
}
|
||||
fprintf(stderr,"fill validated\n");
|
||||
//fprintf(stderr,"fill validated\n");
|
||||
break;
|
||||
case 'E': // fillexchange
|
||||
////////// not implemented yet ////////////
|
||||
@@ -451,7 +451,7 @@ bool AssetsValidate(struct CCcontract_info *cpAssets,Eval* eval,const CTransacti
|
||||
}
|
||||
}
|
||||
////////// not implemented yet ////////////
|
||||
fprintf(stderr,"fill validated\n");
|
||||
//fprintf(stderr,"fill validated\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -462,7 +462,7 @@ bool AssetsValidate(struct CCcontract_info *cpAssets,Eval* eval,const CTransacti
|
||||
|
||||
// what does this do?
|
||||
bool bPrevent = PreventCC(eval, tx, preventCCvins, numvins, preventCCvouts, numvouts);
|
||||
std::cerr << "AssetsValidate() PreventCC returned=" << bPrevent << std::endl;
|
||||
//std::cerr << "AssetsValidate() PreventCC returned=" << bPrevent << std::endl;
|
||||
return (bPrevent);
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ uint8_t *OS_fileptr(long *allocsizep,char *fname);
|
||||
|
||||
int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr)
|
||||
{
|
||||
char cmd[32768]; int32_t i,n,retval=-1; char *filestr,*statusstr,*datastr,fname[128]; long allocsize; cJSON *retjson,*array,*item;
|
||||
char cmd[32768]; int32_t i,n,retval=-1; char *filestr,*pname,*statusstr,*datastr,fname[128]; long allocsize; cJSON *retjson,*array,*item;
|
||||
if ( gametxidstr == 0 || *gametxidstr == 0 )
|
||||
return(retval);
|
||||
sprintf(fname,"%s.gameinfo",gametxidstr);
|
||||
@@ -170,6 +170,8 @@ int32_t rogue_setplayerdata(struct rogue_state *rs,char *gametxidstr)
|
||||
if ( strcmp(statusstr,"registered") == 0 )
|
||||
{
|
||||
retval = 0;
|
||||
if ( (pname= jstr(item,"pname")) != 0 && strlen(pname) < MAXSTR-1 )
|
||||
strcpy(whoami,pname);
|
||||
if ( (item= jobj(item,"player")) != 0 && (datastr= jstr(item,"data")) != 0 )
|
||||
{
|
||||
decode_hex((uint8_t *)&rs->P,(int32_t)strlen(datastr)/2,datastr);
|
||||
|
||||
@@ -198,7 +198,7 @@ uint8_t rogue_highlanderopretdecode(uint256 &gametxid, uint256 &tokenid, int32_t
|
||||
{
|
||||
return(f);
|
||||
}
|
||||
fprintf(stderr,"SKIP obsolete: e.%d f.%c game.%s regslot.%d psize.%d\n",e,f,gametxid.GetHex().c_str(),regslot,(int32_t)playerdata.size());
|
||||
fprintf(stderr,"SKIP obsolete: e.%d f.%c game.%s regslot.%d psize.%d (%s) (%s)\n",e,f,gametxid.GetHex().c_str(),regslot,(int32_t)playerdata.size(),symbol,pname);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ int32_t rogue_playerdata(struct CCcontract_info *cp,uint256 &origplayergame,uint
|
||||
return(0);
|
||||
} else fprintf(stderr,"hash mismatch or illegal gametxid\n");
|
||||
} else fprintf(stderr,"invalid game %s\n",gametxid.GetHex().c_str());
|
||||
}
|
||||
} else fprintf(stderr,"invalid player funcid.%c\n",funcid);
|
||||
} else fprintf(stderr,"couldnt get playertxid.%s\n",playertxid.GetHex().c_str());
|
||||
return(-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user