some diceCC rpc/tests fixes
This commit is contained in:
@@ -201,19 +201,19 @@ class CryptoConditionsTest (BitcoinTestFramework):
|
|||||||
assert_error(result)
|
assert_error(result)
|
||||||
|
|
||||||
# placing 0 amount bet
|
# placing 0 amount bet
|
||||||
result = rpc.dicebet(dicename,diceid,"0","1")
|
result = rpc.dicebet(dicename,diceid,"0","2")
|
||||||
assert_error(result)
|
assert_error(result)
|
||||||
|
|
||||||
# placing negative amount bet
|
# placing negative amount bet
|
||||||
result = rpc.dicebet(dicename,diceid,"-1","1")
|
result = rpc.dicebet(dicename,diceid,"-1","2")
|
||||||
assert_error(result)
|
assert_error(result)
|
||||||
|
|
||||||
# placing bet more than maxbet
|
# placing bet more than maxbet
|
||||||
result = rpc.dicebet(dicename,diceid,"900","1")
|
result = rpc.dicebet(dicename,diceid,"900","2")
|
||||||
assert_error(result)
|
assert_error(result)
|
||||||
|
|
||||||
# placing bet with amount more than funding
|
# placing bet with amount more than funding
|
||||||
result = rpc.dicebet(dicename,diceid,"3000","1")
|
result = rpc.dicebet(dicename,diceid,"3000","2")
|
||||||
assert_error(result)
|
assert_error(result)
|
||||||
|
|
||||||
# placing bet with potential won more than funding
|
# placing bet with potential won more than funding
|
||||||
@@ -233,15 +233,15 @@ class CryptoConditionsTest (BitcoinTestFramework):
|
|||||||
assert_error(result)
|
assert_error(result)
|
||||||
|
|
||||||
# placing bet with not correct dice name
|
# placing bet with not correct dice name
|
||||||
result = rpc.dicebet("nope",diceid,"100","1")
|
result = rpc.dicebet("nope",diceid,"100","2")
|
||||||
assert_error(result)
|
assert_error(result)
|
||||||
|
|
||||||
# placing bet with not correct dice id
|
# placing bet with not correct dice id
|
||||||
result = rpc.dicebet(dicename,self.pubkey,"100","1")
|
result = rpc.dicebet(dicename,self.pubkey,"100","2")
|
||||||
assert_error(result)
|
assert_error(result)
|
||||||
|
|
||||||
# valid bet placing
|
# valid bet placing
|
||||||
placebet = rpc.dicebet(dicename,diceid,"100","1")
|
placebet = rpc.dicebet(dicename,diceid,"100","2")
|
||||||
betid = self.send_and_mine(placebet["hex"])
|
betid = self.send_and_mine(placebet["hex"])
|
||||||
assert result, "bet placed"
|
assert result, "bet placed"
|
||||||
|
|
||||||
|
|||||||
@@ -1066,6 +1066,7 @@ std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet
|
|||||||
return("");
|
return("");
|
||||||
}
|
}
|
||||||
if ( (cp= Diceinit(fundingPubKey,fundingtxid,&C,planstr,txfee,mypk,dicepk,sbits,minbet,maxbet,maxodds,timeoutblocks)) == 0 )
|
if ( (cp= Diceinit(fundingPubKey,fundingtxid,&C,planstr,txfee,mypk,dicepk,sbits,minbet,maxbet,maxodds,timeoutblocks)) == 0 )
|
||||||
|
error = "Diceinit error on Dicebet (probably plan not exists or plan name not match)";
|
||||||
return("");
|
return("");
|
||||||
if ( bet < minbet || bet > maxbet || odds > maxodds )
|
if ( bet < minbet || bet > maxbet || odds > maxodds )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user