Changeset View
Changeset View
Standalone View
Standalone View
src/test/multisig_tests.cpp
Show All 24 Lines | CScript sign_multisig(CScript scriptPubKey, std::vector<CKey> keys, | ||||
uint256 hash = SignatureHash(scriptPubKey, CTransaction(mutableTransaction), | uint256 hash = SignatureHash(scriptPubKey, CTransaction(mutableTransaction), | ||||
whichIn, SigHashType(), Amount::zero()); | whichIn, SigHashType(), Amount::zero()); | ||||
CScript result; | CScript result; | ||||
// CHECKMULTISIG bug workaround | // CHECKMULTISIG bug workaround | ||||
result << OP_0; | result << OP_0; | ||||
for (const CKey &key : keys) { | for (const CKey &key : keys) { | ||||
std::vector<uint8_t> vchSig; | std::vector<uint8_t> vchSig; | ||||
BOOST_CHECK(key.Sign(hash, vchSig)); | BOOST_CHECK(key.SignECDSA(hash, vchSig)); | ||||
vchSig.push_back(uint8_t(SIGHASH_ALL)); | vchSig.push_back(uint8_t(SIGHASH_ALL)); | ||||
result << vchSig; | result << vchSig; | ||||
} | } | ||||
return result; | return result; | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(multisig_verify) { | BOOST_AUTO_TEST_CASE(multisig_verify) { | ||||
uint32_t flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; | uint32_t flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC; | ||||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |