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

Function sign_multisig

src/test/multisig_tests.cpp:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21BOOST_FIXTURE_TEST_SUITE(multisig_tests, BasicTestingSetup)
22
23static CScript
24sign_multisig(const CScript& scriptPubKey, const std::vector<CKey>& keys, const CTransaction& transaction, int whichIn)
25{
26 uint256 hash = SignatureHash(scriptPubKey, transaction, whichIn, SIGHASH_ALL, 0, SigVersion::BASE);
27
28 CScript result;
29 result << OP_0; // CHECKMULTISIG bug workaround
30 for (const CKey &key : keys)
31 {
32 std::vector<unsigned char> vchSig;
33 BOOST_CHECK(key.Sign(hash, vchSig));
34 vchSig.push_back((unsigned char)SIGHASH_ALL);
35 result << vchSig;
36 }
37 return result;
38}
39
40BOOST_AUTO_TEST_CASE(multisig_verify)
41{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.70

Calls 3

SignatureHashFunction · 0.85
SignMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected