Skip to content

Commit

Permalink
Fix p2pkh tests asserts (dashpay#2153)
Browse files Browse the repository at this point in the history
Even the results were as expected,
IsPayToPublicKeyHash() breaks at size checking step now, as was intended.
Also removes compile time array-bounds warning.
  • Loading branch information
wozniakk authored and andvgal committed Dec 25, 2018
1 parent 5c61679 commit 5d35e7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/script_P2PKH_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ BOOST_AUTO_TEST_CASE(IsPayToPublicKeyHash)
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
};
BOOST_CHECK(!CScript(missing2, missing2+sizeof(missing)).IsPayToPublicKeyHash());
BOOST_CHECK(!CScript(missing2, missing2+sizeof(missing2)).IsPayToPublicKeyHash());

static const unsigned char tooshort[] = {
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());

}

Expand Down

0 comments on commit 5d35e7a

Please sign in to comment.