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

Function sign_multisig

src/test/multisig_tests.cpp:21–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.70

Calls 3

SignMethod · 0.80
SignatureHashFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected