MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Verify

Function Verify

src/test/script_p2sh_tests.cpp:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39static 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
58BOOST_FIXTURE_TEST_SUITE(script_p2sh_tests, BasicTestingSetup)

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

VerifyScriptFunction · 0.85
resizeMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected