Changeset View
Changeset View
Standalone View
Standalone View
src/test/script_standard_tests.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(script_standard_Solver_success) { | ||||
CKey keys[3]; | CKey keys[3]; | ||||
CPubKey pubkeys[3]; | CPubKey pubkeys[3]; | ||||
for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
keys[i].MakeNewKey(true); | keys[i].MakeNewKey(true); | ||||
pubkeys[i] = keys[i].GetPubKey(); | pubkeys[i] = keys[i].GetPubKey(); | ||||
} | } | ||||
CScript s; | CScript s; | ||||
txnouttype whichType; | |||||
std::vector<std::vector<uint8_t>> solutions; | std::vector<std::vector<uint8_t>> solutions; | ||||
// TX_PUBKEY | // TX_PUBKEY | ||||
s.clear(); | s.clear(); | ||||
s << ToByteVector(pubkeys[0]) << OP_CHECKSIG; | s << ToByteVector(pubkeys[0]) << OP_CHECKSIG; | ||||
BOOST_CHECK(Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_PUBKEY); | ||||
BOOST_CHECK_EQUAL(whichType, TX_PUBKEY); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 1U); | BOOST_CHECK_EQUAL(solutions.size(), 1U); | ||||
BOOST_CHECK(solutions[0] == ToByteVector(pubkeys[0])); | BOOST_CHECK(solutions[0] == ToByteVector(pubkeys[0])); | ||||
// TX_PUBKEYHASH | // TX_PUBKEYHASH | ||||
s.clear(); | s.clear(); | ||||
s << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) | s << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) | ||||
<< OP_EQUALVERIFY << OP_CHECKSIG; | << OP_EQUALVERIFY << OP_CHECKSIG; | ||||
BOOST_CHECK(Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_PUBKEYHASH); | ||||
BOOST_CHECK_EQUAL(whichType, TX_PUBKEYHASH); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 1U); | BOOST_CHECK_EQUAL(solutions.size(), 1U); | ||||
BOOST_CHECK(solutions[0] == ToByteVector(pubkeys[0].GetID())); | BOOST_CHECK(solutions[0] == ToByteVector(pubkeys[0].GetID())); | ||||
// TX_SCRIPTHASH | // TX_SCRIPTHASH | ||||
CScript redeemScript(s); // initialize with leftover P2PKH script | CScript redeemScript(s); // initialize with leftover P2PKH script | ||||
s.clear(); | s.clear(); | ||||
s << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL; | s << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL; | ||||
BOOST_CHECK(Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_SCRIPTHASH); | ||||
BOOST_CHECK_EQUAL(whichType, TX_SCRIPTHASH); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 1U); | BOOST_CHECK_EQUAL(solutions.size(), 1U); | ||||
BOOST_CHECK(solutions[0] == ToByteVector(CScriptID(redeemScript))); | BOOST_CHECK(solutions[0] == ToByteVector(CScriptID(redeemScript))); | ||||
// TX_MULTISIG | // TX_MULTISIG | ||||
s.clear(); | s.clear(); | ||||
s << OP_1 << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]) << OP_2 | s << OP_1 << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]) << OP_2 | ||||
<< OP_CHECKMULTISIG; | << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_MULTISIG); | ||||
BOOST_CHECK_EQUAL(whichType, TX_MULTISIG); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 4U); | BOOST_CHECK_EQUAL(solutions.size(), 4U); | ||||
BOOST_CHECK(solutions[0] == std::vector<uint8_t>({1})); | BOOST_CHECK(solutions[0] == std::vector<uint8_t>({1})); | ||||
BOOST_CHECK(solutions[1] == ToByteVector(pubkeys[0])); | BOOST_CHECK(solutions[1] == ToByteVector(pubkeys[0])); | ||||
BOOST_CHECK(solutions[2] == ToByteVector(pubkeys[1])); | BOOST_CHECK(solutions[2] == ToByteVector(pubkeys[1])); | ||||
BOOST_CHECK(solutions[3] == std::vector<uint8_t>({2})); | BOOST_CHECK(solutions[3] == std::vector<uint8_t>({2})); | ||||
s.clear(); | s.clear(); | ||||
s << OP_2 << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]) | s << OP_2 << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]) | ||||
<< ToByteVector(pubkeys[2]) << OP_3 << OP_CHECKMULTISIG; | << ToByteVector(pubkeys[2]) << OP_3 << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_MULTISIG); | ||||
BOOST_CHECK_EQUAL(whichType, TX_MULTISIG); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 5U); | BOOST_CHECK_EQUAL(solutions.size(), 5U); | ||||
BOOST_CHECK(solutions[0] == std::vector<uint8_t>({2})); | BOOST_CHECK(solutions[0] == std::vector<uint8_t>({2})); | ||||
BOOST_CHECK(solutions[1] == ToByteVector(pubkeys[0])); | BOOST_CHECK(solutions[1] == ToByteVector(pubkeys[0])); | ||||
BOOST_CHECK(solutions[2] == ToByteVector(pubkeys[1])); | BOOST_CHECK(solutions[2] == ToByteVector(pubkeys[1])); | ||||
BOOST_CHECK(solutions[3] == ToByteVector(pubkeys[2])); | BOOST_CHECK(solutions[3] == ToByteVector(pubkeys[2])); | ||||
BOOST_CHECK(solutions[4] == std::vector<uint8_t>({3})); | BOOST_CHECK(solutions[4] == std::vector<uint8_t>({3})); | ||||
// TX_NULL_DATA | // TX_NULL_DATA | ||||
s.clear(); | s.clear(); | ||||
s << OP_RETURN << std::vector<uint8_t>({0}) << std::vector<uint8_t>({75}) | s << OP_RETURN << std::vector<uint8_t>({0}) << std::vector<uint8_t>({75}) | ||||
<< std::vector<uint8_t>({255}); | << std::vector<uint8_t>({255}); | ||||
BOOST_CHECK(Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NULL_DATA); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NULL_DATA); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0U); | BOOST_CHECK_EQUAL(solutions.size(), 0U); | ||||
// TX_WITNESS_V0_KEYHASH | // TX_WITNESS_V0_KEYHASH | ||||
s.clear(); | s.clear(); | ||||
s << OP_0 << ToByteVector(pubkeys[0].GetID()); | s << OP_0 << ToByteVector(pubkeys[0].GetID()); | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0U); | BOOST_CHECK_EQUAL(solutions.size(), 0U); | ||||
// TX_WITNESS_V0_SCRIPTHASH | // TX_WITNESS_V0_SCRIPTHASH | ||||
uint256 scriptHash; | uint256 scriptHash; | ||||
CSHA256() | CSHA256() | ||||
.Write(&redeemScript[0], redeemScript.size()) | .Write(&redeemScript[0], redeemScript.size()) | ||||
.Finalize(scriptHash.begin()); | .Finalize(scriptHash.begin()); | ||||
s.clear(); | s.clear(); | ||||
s << OP_0 << ToByteVector(scriptHash); | s << OP_0 << ToByteVector(scriptHash); | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0U); | BOOST_CHECK_EQUAL(solutions.size(), 0U); | ||||
// TX_NONSTANDARD | // TX_NONSTANDARD | ||||
s.clear(); | s.clear(); | ||||
s << OP_9 << OP_ADD << OP_11 << OP_EQUAL; | s << OP_9 << OP_ADD << OP_11 << OP_EQUAL; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
// Try some non-minimal PUSHDATA pushes in various standard scripts | // Try some non-minimal PUSHDATA pushes in various standard scripts | ||||
for (auto pushdataop : {OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4}) { | for (auto pushdataop : {OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4}) { | ||||
// mutated TX_PUBKEY | // mutated TX_PUBKEY | ||||
s.clear(); | s.clear(); | ||||
AppendPush(s, pushdataop, ToByteVector(pubkeys[0])); | AppendPush(s, pushdataop, ToByteVector(pubkeys[0])); | ||||
s << OP_CHECKSIG; | s << OP_CHECKSIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
// mutated TX_PUBKEYHASH | // mutated TX_PUBKEYHASH | ||||
s.clear(); | s.clear(); | ||||
s << OP_DUP << OP_HASH160; | s << OP_DUP << OP_HASH160; | ||||
AppendPush(s, pushdataop, ToByteVector(pubkeys[0].GetID())); | AppendPush(s, pushdataop, ToByteVector(pubkeys[0].GetID())); | ||||
s << OP_EQUALVERIFY << OP_CHECKSIG; | s << OP_EQUALVERIFY << OP_CHECKSIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
// mutated TX_SCRIPTHASH | // mutated TX_SCRIPTHASH | ||||
s.clear(); | s.clear(); | ||||
s << OP_HASH160; | s << OP_HASH160; | ||||
AppendPush(s, pushdataop, ToByteVector(CScriptID(redeemScript))); | AppendPush(s, pushdataop, ToByteVector(CScriptID(redeemScript))); | ||||
s << OP_EQUAL; | s << OP_EQUAL; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
// mutated TX_MULTISIG -- pubkey | // mutated TX_MULTISIG -- pubkey | ||||
s.clear(); | s.clear(); | ||||
s << OP_1; | s << OP_1; | ||||
AppendPush(s, pushdataop, ToByteVector(pubkeys[0])); | AppendPush(s, pushdataop, ToByteVector(pubkeys[0])); | ||||
s << ToByteVector(pubkeys[1]) << OP_2 << OP_CHECKMULTISIG; | s << ToByteVector(pubkeys[1]) << OP_2 << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
// mutated TX_MULTISIG -- num_signatures | // mutated TX_MULTISIG -- num_signatures | ||||
s.clear(); | s.clear(); | ||||
AppendPush(s, pushdataop, {1}); | AppendPush(s, pushdataop, {1}); | ||||
s << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]) << OP_2 | s << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]) << OP_2 | ||||
<< OP_CHECKMULTISIG; | << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
// mutated TX_MULTISIG -- num_pubkeys | // mutated TX_MULTISIG -- num_pubkeys | ||||
s.clear(); | s.clear(); | ||||
s << OP_1 << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]); | s << OP_1 << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]); | ||||
AppendPush(s, pushdataop, {2}); | AppendPush(s, pushdataop, {2}); | ||||
s << OP_CHECKMULTISIG; | s << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
} | } | ||||
// also try pushing the num_signatures and num_pubkeys using PUSH_N opcode | // also try pushing the num_signatures and num_pubkeys using PUSH_N opcode | ||||
// instead of OP_N opcode: | // instead of OP_N opcode: | ||||
s.clear(); | s.clear(); | ||||
s << std::vector<uint8_t>{1} << ToByteVector(pubkeys[0]) | s << std::vector<uint8_t>{1} << ToByteVector(pubkeys[0]) | ||||
<< ToByteVector(pubkeys[1]) << OP_2 << OP_CHECKMULTISIG; | << ToByteVector(pubkeys[1]) << OP_2 << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
s.clear(); | s.clear(); | ||||
s << OP_1 << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]) | s << OP_1 << ToByteVector(pubkeys[0]) << ToByteVector(pubkeys[1]) | ||||
<< std::vector<uint8_t>{2} << OP_CHECKMULTISIG; | << std::vector<uint8_t>{2} << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
// Non-minimal pushes in OP_RETURN scripts are standard (some OP_RETURN | // Non-minimal pushes in OP_RETURN scripts are standard (some OP_RETURN | ||||
// protocols like SLP rely on this). Also it turns out OP_RESERVED gets past | // protocols like SLP rely on this). Also it turns out OP_RESERVED gets past | ||||
// IsPushOnly and thus is standard here. | // IsPushOnly and thus is standard here. | ||||
std::vector<uint8_t> op_return_nonminimal{ | std::vector<uint8_t> op_return_nonminimal{ | ||||
OP_RETURN, OP_RESERVED, OP_PUSHDATA1, 0x00, 0x01, 0x01, | OP_RETURN, OP_RESERVED, OP_PUSHDATA1, 0x00, 0x01, 0x01, | ||||
OP_PUSHDATA4, 0x01, 0x00, 0x00, 0x00, 0xaa}; | OP_PUSHDATA4, 0x01, 0x00, 0x00, 0x00, 0xaa}; | ||||
s.assign(op_return_nonminimal.begin(), op_return_nonminimal.end()); | s.assign(op_return_nonminimal.begin(), op_return_nonminimal.end()); | ||||
BOOST_CHECK(Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NULL_DATA); | ||||
BOOST_CHECK_EQUAL(whichType, TX_NULL_DATA); | |||||
BOOST_CHECK_EQUAL(solutions.size(), 0); | BOOST_CHECK_EQUAL(solutions.size(), 0); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(script_standard_Solver_failure) { | BOOST_AUTO_TEST_CASE(script_standard_Solver_failure) { | ||||
CKey key; | CKey key; | ||||
CPubKey pubkey; | CPubKey pubkey; | ||||
key.MakeNewKey(true); | key.MakeNewKey(true); | ||||
pubkey = key.GetPubKey(); | pubkey = key.GetPubKey(); | ||||
CScript s; | CScript s; | ||||
txnouttype whichType; | |||||
std::vector<std::vector<uint8_t>> solutions; | std::vector<std::vector<uint8_t>> solutions; | ||||
// TX_PUBKEY with incorrectly sized pubkey | // TX_PUBKEY with incorrectly sized pubkey | ||||
s.clear(); | s.clear(); | ||||
s << std::vector<uint8_t>(30, 0x01) << OP_CHECKSIG; | s << std::vector<uint8_t>(30, 0x01) << OP_CHECKSIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_PUBKEYHASH with incorrectly sized key hash | // TX_PUBKEYHASH with incorrectly sized key hash | ||||
s.clear(); | s.clear(); | ||||
s << OP_DUP << OP_HASH160 << ToByteVector(pubkey) << OP_EQUALVERIFY | s << OP_DUP << OP_HASH160 << ToByteVector(pubkey) << OP_EQUALVERIFY | ||||
<< OP_CHECKSIG; | << OP_CHECKSIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_SCRIPTHASH with incorrectly sized script hash | // TX_SCRIPTHASH with incorrectly sized script hash | ||||
s.clear(); | s.clear(); | ||||
s << OP_HASH160 << std::vector<uint8_t>(21, 0x01) << OP_EQUAL; | s << OP_HASH160 << std::vector<uint8_t>(21, 0x01) << OP_EQUAL; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_MULTISIG 0/2 | // TX_MULTISIG 0/2 | ||||
s.clear(); | s.clear(); | ||||
s << OP_0 << ToByteVector(pubkey) << OP_1 << OP_CHECKMULTISIG; | s << OP_0 << ToByteVector(pubkey) << OP_1 << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_MULTISIG 2/1 | // TX_MULTISIG 2/1 | ||||
s.clear(); | s.clear(); | ||||
s << OP_2 << ToByteVector(pubkey) << OP_1 << OP_CHECKMULTISIG; | s << OP_2 << ToByteVector(pubkey) << OP_1 << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_MULTISIG n = 2 with 1 pubkey | // TX_MULTISIG n = 2 with 1 pubkey | ||||
s.clear(); | s.clear(); | ||||
s << OP_1 << ToByteVector(pubkey) << OP_2 << OP_CHECKMULTISIG; | s << OP_1 << ToByteVector(pubkey) << OP_2 << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_MULTISIG n = 1 with 0 pubkeys | // TX_MULTISIG n = 1 with 0 pubkeys | ||||
s.clear(); | s.clear(); | ||||
s << OP_1 << OP_1 << OP_CHECKMULTISIG; | s << OP_1 << OP_1 << OP_CHECKMULTISIG; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_NULL_DATA with other opcodes | // TX_NULL_DATA with other opcodes | ||||
s.clear(); | s.clear(); | ||||
s << OP_RETURN << std::vector<uint8_t>({75}) << OP_ADD; | s << OP_RETURN << std::vector<uint8_t>({75}) << OP_ADD; | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_WITNESS with unknown version | // TX_WITNESS with unknown version | ||||
s.clear(); | s.clear(); | ||||
s << OP_1 << ToByteVector(pubkey); | s << OP_1 << ToByteVector(pubkey); | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
// TX_WITNESS with incorrect program size | // TX_WITNESS with incorrect program size | ||||
s.clear(); | s.clear(); | ||||
s << OP_0 << std::vector<uint8_t>(19, 0x01); | s << OP_0 << std::vector<uint8_t>(19, 0x01); | ||||
BOOST_CHECK(!Solver(s, whichType, solutions)); | BOOST_CHECK_EQUAL(Solver(s, solutions), TX_NONSTANDARD); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination) { | BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination) { | ||||
CKey key; | CKey key; | ||||
CPubKey pubkey; | CPubKey pubkey; | ||||
key.MakeNewKey(true); | key.MakeNewKey(true); | ||||
pubkey = key.GetPubKey(); | pubkey = key.GetPubKey(); | ||||
▲ Show 20 Lines • Show All 377 Lines • Show Last 20 Lines |