Add unit tests for peg-in authorization

This commit is contained in:
Gregory Sanders 2017-09-18 13:32:24 -04:00
parent be735cf397
commit 4aad513939
5 changed files with 143 additions and 4 deletions

View file

@ -2399,6 +2399,9 @@ bool IsValidPeginWitness(const CScriptWitness& pegin_witness, const COutPoint& p
CScript fedpegscript = Params().GetConsensus().fedpegScript;
// fedpegscript should be multisig or OP_TRUE
// When set to OP_TRUE, the witness program can be any valid witness program
// as there are no pubkeys to tweak. This means typically in regtest there
// is no spending authorization for peg-in inputs.
txnouttype type;
std::vector<std::vector<unsigned char> > solutions;
if (!Solver(fedpegscript, type, solutions) || (type != TX_MULTISIG && type != TX_TRUE)) {