MCPcopy Create free account
hub / github.com/ElementsProject/elements / Verify

Function Verify

src/test/script_p2sh_tests.cpp:28–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28static bool
29Verify(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
48BOOST_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