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 CryptoCentric committed Mar 7, 2019
1 parent 69ccc9e commit 500d3b3
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 @@ -45,12 +45,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 500d3b3

Please sign in to comment.