mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Replace direct use of 0 with SetNull and IsNull
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
This commit is contained in:
@@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(pmt_test1)
|
||||
|
||||
// calculate actual merkle root and height
|
||||
uint256 merkleRoot1 = block.BuildMerkleTree();
|
||||
std::vector<uint256> vTxid(nTx, 0);
|
||||
std::vector<uint256> vTxid(nTx, uint256());
|
||||
for (unsigned int j=0; j<nTx; j++)
|
||||
vTxid[j] = block.vtx[j].GetHash();
|
||||
int nHeight = 1, nTx_ = nTx;
|
||||
@@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE(pmt_test1)
|
||||
|
||||
// check that it has the same merkle root as the original, and a valid one
|
||||
BOOST_CHECK(merkleRoot1 == merkleRoot2);
|
||||
BOOST_CHECK(merkleRoot2 != 0);
|
||||
BOOST_CHECK(!merkleRoot2.IsNull());
|
||||
|
||||
// check that it contains the matched transactions (in the same order!)
|
||||
BOOST_CHECK(vMatchTxid1 == vMatchTxid2);
|
||||
@@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE(pmt_malleability)
|
||||
|
||||
CPartialMerkleTree tree(vTxid, vMatch);
|
||||
std::vector<uint256> vTxid2;
|
||||
BOOST_CHECK(tree.ExtractMatches(vTxid) == 0);
|
||||
BOOST_CHECK(tree.ExtractMatches(vTxid).IsNull());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user