Fix p2pkh tests asserts (#2153)

Even the results were as expected,
IsPayToPublicKeyHash() breaks at size checking step now, as was intended.
Also removes compile time array-bounds warning.
This commit is contained in:
Kamil Woźniak 2018-06-29 00:23:25 +02:00 committed by UdjinM6
parent 26c891f67f
commit 4dbde218b9

View File

@ -45,12 +45,12 @@ BOOST_AUTO_TEST_CASE(IsPayToPublicKeyHash)
static const unsigned char missing2[] = { static const unsigned char missing2[] = {
OP_DUP, OP_HASH160, 20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 OP_DUP, OP_HASH160, 20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
}; };
BOOST_CHECK(!CScript(missing2, missing2+sizeof(missing)).IsPayToPublicKeyHash()); BOOST_CHECK(!CScript(missing2, missing2+sizeof(missing2)).IsPayToPublicKeyHash());
static const unsigned char tooshort[] = { static const unsigned char tooshort[] = {
OP_DUP, OP_HASH160, 2, 0,0, OP_EQUALVERIFY, OP_CHECKSIG OP_DUP, OP_HASH160, 2, 0,0, OP_EQUALVERIFY, OP_CHECKSIG
}; };
BOOST_CHECK(!CScript(tooshort, tooshort+sizeof(direct)).IsPayToPublicKeyHash()); BOOST_CHECK(!CScript(tooshort, tooshort+sizeof(tooshort)).IsPayToPublicKeyHash());
} }