Skip to content

Commit

Permalink
Revert "Remove test changes"
Browse files Browse the repository at this point in the history
This reverts commit 0075407.
  • Loading branch information
Ross Nicoll committed Nov 26, 2021
1 parent 0075407 commit 80243b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/merkle_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static std::vector<uint256> ComputeMerkleBranch(const std::vector<uint256>& leav
return ret;
}

static std::vector<uint256> BlockMerkleBranch(const CBlock& block, uint32_t position)
std::vector<uint256> BlockMerkleBranch(const CBlock& block, uint32_t position)
{
std::vector<uint256> leaves;
leaves.resize(block.vtx.size());
Expand Down
9 changes: 9 additions & 0 deletions src/test/util/setup_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,12 @@ CBlock getBlock13b8a()
stream >> block;
return block;
}

//! equality test
bool operator==(const Coin &a, const Coin &b) {
// Empty Coin objects are always equal.
if (a.IsSpent() && b.IsSpent()) return true;
return a.fCoinBase == b.fCoinBase &&
a.nHeight == b.nHeight &&
a.out == b.out;
}
5 changes: 5 additions & 0 deletions src/test/util/setup_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,9 @@ class HasReason
const std::string m_reason;
};

/* This is defined in merkle_tests.cpp, but also used by auxpow_tests.cpp. */
namespace merkle_tests {
std::vector<uint256> BlockMerkleBranch(const CBlock& block, uint32_t position);
}

#endif

0 comments on commit 80243b0

Please sign in to comment.