mock up DisputePayout
This commit is contained in:
@@ -14,5 +14,36 @@ bool EvalConditionValidity(const CC *cond, const CTransaction *tx, int nIn);
|
||||
*/
|
||||
bool CheckImportPayout(const CC *cond, const CTransaction *payoutTx, int nIn);
|
||||
|
||||
/*
|
||||
* Virtual machine to use in the case of on-chain app evaluation
|
||||
*/
|
||||
class AppVM
|
||||
{
|
||||
public:
|
||||
/*
|
||||
* in: header - paramters agreed upon by all players
|
||||
* in: body - gamestate
|
||||
* out: length - length of game (longest wins)
|
||||
* out: payments - vector of CTxOut, always deterministically sorted.
|
||||
*/
|
||||
virtual std::pair<int,std::vector<CTxOut>>
|
||||
evaluate(std::vector<unsigned char> header, std::vector<unsigned char> body) = 0;
|
||||
};
|
||||
|
||||
/*
|
||||
* Test a DisputePayout CC Eval condition, using a provided AppVM
|
||||
*/
|
||||
bool DisputePayout(AppVM &vm, const CC *cond, const CTransaction *disputeTx, int nIn);
|
||||
|
||||
/*
|
||||
* Get PUSHDATA from a script
|
||||
*/
|
||||
bool GetPushData(const CScript &sig, std::vector<unsigned char> &data);
|
||||
|
||||
/*
|
||||
* Get OP_RETURN data from a script
|
||||
*/
|
||||
bool GetOpReturnData(const CScript &sig, std::vector<unsigned char> &data);
|
||||
|
||||
|
||||
#endif /* CC_EVAL_H */
|
||||
|
||||
Reference in New Issue
Block a user