mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
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:
parent
26c891f67f
commit
4dbde218b9
@ -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());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user