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

Function BOOST_AUTO_TEST_CASE

src/test/script_segwit_tests.cpp:12–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10BOOST_FIXTURE_TEST_SUITE(script_segwit_tests, BasicTestingSetup)
11
12BOOST_AUTO_TEST_CASE(IsPayToWitnessScriptHash_Valid)
13{
14 uint256 dummy;
15 CScript p2wsh;
16 p2wsh << OP_0 << ToByteVector(dummy);
17 BOOST_CHECK(p2wsh.IsPayToWitnessScriptHash());
18
19 std::vector<unsigned char> bytes = {OP_0, 32};
20 bytes.insert(bytes.end(), 32, 0);
21 BOOST_CHECK(CScript(bytes.begin(), bytes.end()).IsPayToWitnessScriptHash());
22}
23
24BOOST_AUTO_TEST_CASE(IsPayToWitnessScriptHash_Invalid_NotOp0)
25{

Callers

nothing calls this directly

Calls 11

ToByteVectorFunction · 0.85
IsExpectedWitnessProgramFunction · 0.85
IsNoWitnessProgramFunction · 0.85
CScriptClass · 0.50
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
clearMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected