| 26 | } |
| 27 | |
| 28 | static bool |
| 29 | Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict, ScriptError& err) |
| 30 | { |
| 31 | // Create dummy to/from transactions: |
| 32 | CMutableTransaction txFrom; |
| 33 | txFrom.vout.resize(1); |
| 34 | txFrom.vout[0].scriptPubKey = scriptPubKey; |
| 35 | |
| 36 | CMutableTransaction txTo; |
| 37 | txTo.vin.resize(1); |
| 38 | txTo.vout.resize(1); |
| 39 | txTo.vin[0].prevout.n = 0; |
| 40 | txTo.vin[0].prevout.hash = txFrom.GetHash(); |
| 41 | txTo.vin[0].scriptSig = scriptSig; |
| 42 | txTo.vout[0].nValue = 1; |
| 43 | |
| 44 | return VerifyScript(scriptSig, scriptPubKey, nullptr, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, MutableTransactionSignatureChecker(&txTo, 0, txFrom.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL), &err); |
| 45 | } |
| 46 | |
| 47 | |
| 48 | BOOST_FIXTURE_TEST_SUITE(script_p2sh_tests, BasicTestingSetup) |
no test coverage detected