From 7596077f2a3fbe657dc6897906cf1d0d9c20cfc7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Mar 2019 07:10:30 -1100 Subject: [PATCH] Settle stub --- src/cc/games/prices.cpp | 7 +++++++ src/cc/games/tetris.cpp | 8 +++++++- src/cc/gamescc.h | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/cc/games/prices.cpp b/src/cc/games/prices.cpp index a49fc1982..4098a3980 100644 --- a/src/cc/games/prices.cpp +++ b/src/cc/games/prices.cpp @@ -17,6 +17,13 @@ UniValue games_rawtxresult(UniValue &result,std::string rawtx,int32_t broadcastflag); extern uint8_t ASSETCHAINS_OVERRIDE_PUBKEY33[33]; + +UniValue games_settle(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) +{ + UniValue result; + return(result); +} + UniValue games_bet(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) { CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), komodo_nextheight()); diff --git a/src/cc/games/tetris.cpp b/src/cc/games/tetris.cpp index 12c443e1e..d1ca9c30b 100644 --- a/src/cc/games/tetris.cpp +++ b/src/cc/games/tetris.cpp @@ -66,7 +66,13 @@ int32_t games_payloadrecv(CPubKey pk,uint32_t timestamp,std::vector pay } else return(-1); } -UniValue games_oracledata(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) +UniValue games_bet(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) +{ + UniValue result; + return(result); +} + +UniValue games_settle(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) { UniValue result; return(result); diff --git a/src/cc/gamescc.h b/src/cc/gamescc.h index 52627cd1c..7a6b7c66c 100644 --- a/src/cc/gamescc.h +++ b/src/cc/gamescc.h @@ -47,6 +47,7 @@ std::string Games_pname; { (char *)MYCCNAME, (char *)"events", (char *)"eventshex [gametxid [eventid]]", 1, 3, ' ', EVAL_GAMES }, \ { (char *)MYCCNAME, (char *)"extract", (char *)"gametxid [pubkey]", 1, 2, ' ', EVAL_GAMES }, \ { (char *)MYCCNAME, (char *)"bet", (char *)"amount hexstr", 2, 2, ' ', EVAL_GAMES }, \ + { (char *)MYCCNAME, (char *)"settle", (char *)"height", 1, 1, ' ', EVAL_GAMES }, \ { (char *)MYCCNAME, (char *)"register", (char *)"gametxid [playertxid]", 1, 2, 'R', EVAL_GAMES }, bool games_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx); @@ -67,6 +68,7 @@ UniValue games_events(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); UniValue games_extract(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); UniValue games_register(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); UniValue games_bet(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); +UniValue games_settle(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); #define CUSTOM_DISPATCH \ if ( cp->evalcode == EVAL_GAMES ) \ @@ -105,6 +107,8 @@ if ( cp->evalcode == EVAL_GAMES ) \ return(games_fund(txfee,cp,params)); \ else if ( strcmp(method,"bet") == 0 ) \ return(games_bet(txfee,cp,params)); \ + else if ( strcmp(method,"settle") == 0 ) \ + return(games_settle(txfee,cp,params)); \ else \ { \ result.push_back(Pair("result","error")); \