| 37 | } |
| 38 | |
| 39 | static bool Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict, ScriptError& err) |
| 40 | { |
| 41 | // Create dummy to/from transactions: |
| 42 | CMutableTransaction txFrom; |
| 43 | txFrom.vout.resize(1); |
| 44 | txFrom.vout[0].scriptPubKey = scriptPubKey; |
| 45 | |
| 46 | CMutableTransaction txTo; |
| 47 | txTo.vin.resize(1); |
| 48 | txTo.vout.resize(1); |
| 49 | txTo.vin[0].prevout.n = 0; |
| 50 | txTo.vin[0].prevout.hash = txFrom.GetHash(); |
| 51 | txTo.vin[0].scriptSig = scriptSig; |
| 52 | txTo.vout[0].nValue = 1; |
| 53 | |
| 54 | return VerifyScript(scriptSig, scriptPubKey, nullptr, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, MutableTransactionSignatureChecker(&txTo, 0, txFrom.vout[0].nValue, MissingDataBehavior::ASSERT_FAIL), &err); |
| 55 | } |
| 56 | |
| 57 | |
| 58 | BOOST_FIXTURE_TEST_SUITE(script_p2sh_tests, BasicTestingSetup) |
no test coverage detected