Skip to content

Commit 5021ef8

Browse files
author
MarcoFalke
committed
Merge #17254: test: fix script_p2sh_tests OP_PUSHBACK2/4 missing
5710dad test: fix script_p2sh_tests OP_PUSHBACK2/4 missing (kodslav) Pull request description: Cleans up #15140 which fixes commit 6b25f29 where opcodes were lost in translation. ACKs for top commit: laanwj: code review ACK 5710dad Tree-SHA512: 3f7fbcaf0dd199626d9ec9fdf3c5b5c5c2a91c4cfe81fae5b1d5662a48e52cf4bd27c94f8f42ebdfe7a076c5d600ada5661a6902b03eb5dc3dc953f4524345ac
2 parents c737839 + 5710dad commit 5021ef8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/test/script_p2sh_tests.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,21 @@ BOOST_AUTO_TEST_CASE(is)
209209
p2sh << OP_HASH160 << ToByteVector(dummy) << OP_EQUAL;
210210
BOOST_CHECK(p2sh.IsPayToScriptHash());
211211

212-
// Not considered pay-to-script-hash if using one of the OP_PUSHDATA opcodes:
213212
std::vector<unsigned char> direct = {OP_HASH160, 20};
214213
direct.insert(direct.end(), 20, 0);
215214
direct.push_back(OP_EQUAL);
216215
BOOST_CHECK(CScript(direct.begin(), direct.end()).IsPayToScriptHash());
216+
217+
// Not considered pay-to-script-hash if using one of the OP_PUSHDATA opcodes:
217218
std::vector<unsigned char> pushdata1 = {OP_HASH160, OP_PUSHDATA1, 20};
218219
pushdata1.insert(pushdata1.end(), 20, 0);
219220
pushdata1.push_back(OP_EQUAL);
220221
BOOST_CHECK(!CScript(pushdata1.begin(), pushdata1.end()).IsPayToScriptHash());
221-
std::vector<unsigned char> pushdata2 = {OP_HASH160, 20, 0};
222+
std::vector<unsigned char> pushdata2 = {OP_HASH160, OP_PUSHDATA2, 20, 0};
222223
pushdata2.insert(pushdata2.end(), 20, 0);
223224
pushdata2.push_back(OP_EQUAL);
224225
BOOST_CHECK(!CScript(pushdata2.begin(), pushdata2.end()).IsPayToScriptHash());
225-
std::vector<unsigned char> pushdata4 = {OP_HASH160, 20, 0, 0, 0};
226+
std::vector<unsigned char> pushdata4 = {OP_HASH160, OP_PUSHDATA4, 20, 0, 0, 0};
226227
pushdata4.insert(pushdata4.end(), 20, 0);
227228
pushdata4.push_back(OP_EQUAL);
228229
BOOST_CHECK(!CScript(pushdata4.begin(), pushdata4.end()).IsPayToScriptHash());

0 commit comments

Comments
 (0)