]> Git Repo - VerusCoin.git/commitdiff
Test
authorjl777 <[email protected]>
Mon, 23 Jul 2018 11:15:05 +0000 (00:15 -1100)
committerjl777 <[email protected]>
Mon, 23 Jul 2018 11:15:05 +0000 (00:15 -1100)
src/cc/CCassetsCore.cpp
src/cc/assets.cpp
src/cc/eval.cpp

index 26b4fc6639a04b2ab5ed9920dfe821510602c5d2..ba0769d469c26f9792083f7e8070be3288e41981 100644 (file)
@@ -67,7 +67,7 @@ bool ValidateAssetRemainder(uint64_t remaining_price,uint64_t remaining_nValue,u
         }
         if ( remaining_price != 0 )
             newunitprice = (remaining_nValue * COIN) / remaining_price;
-        fprintf(stderr,"recvunitprice %.8f >= %.8f unitprice, new unitprice %.8f\n",(double)recvunitprice/COIN,(double)unitprice/COIN,(double)newunitprice/COIN);
+        fprintf(stderr,"recvunitprice %.16f >= %.16f unitprice, new unitprice %.16f\n",(double)recvunitprice/(COIN*COIN),(double)unitprice/(COIN*COIN),(double)newunitprice/(COIN*COIN));
     }
     return(true);
 }
@@ -93,7 +93,7 @@ bool SetAssetFillamounts(uint64_t &received_nValue,uint64_t &remaining_price,uin
         return(true);
     }
     remaining_price = (totalunits - paidunits);
-    unitprice = (orig_nValue * COIN) / totalunits;
+    unitprice = (orig_nValue * COIN) / totalunits; // unit price has 10 decimals precision, eg. unitprice of 100 million is 1 COIN per unit
     if ( unitprice > 0 && (received_nValue= (paidunits * unitprice)/COIN) > 0 && received_nValue < orig_nValue )
     {
         remaining_nValue = (orig_nValue - received_nValue);
index d5bdc834ebad9d3ed8ddec3894aa36c326073b41..8c845ba686c40088f9d8f7d87c7e6118d1aabe4c 100644 (file)
@@ -329,6 +329,8 @@ bool ProcessAssets(Eval* eval, std::vector<uint8_t> paramsNull,const CTransactio
     else if ( AssetValidate(eval,ctx,n,funcid,assetid,assetid2,amount,origpubkey) != 0 )
     {
         //prevtxid = txid;
+        if ( funcid == 'B' )
+            return(false);
         fprintf(stderr,"AssetValidate.(%c) passed\n",funcid);
         return(true);
     }
index 91a507030784d6161b739fbd9de46f2a663458c4..3f70b6466ca363f1fd7a63957a571c9d3bfd7cb8 100644 (file)
@@ -35,6 +35,7 @@ bool RunCCEval(const CC *cond, const CTransaction &tx, unsigned int nIn)
     EvalRef eval;
 
     bool out = eval->Dispatch(cond, tx, nIn);
+    fprintf(stderr,"out %d vs %d isValid\n",(int32_t)out,(int32_t)eval->state.IsValid());
     assert(eval->state.IsValid() == out);
 
     if (eval->state.IsValid()) return true;
This page took 0.030781 seconds and 4 git commands to generate.