mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-05 13:17:49 +02:00
clusterlin: remove Cluster type
This commit is contained in:
@@ -23,18 +23,18 @@ namespace {
|
||||
constexpr std::pair<FeeFrac, TestBitSet> HOLE{FeeFrac{0, 0x3FFFFF}, {}};
|
||||
|
||||
template<typename SetType>
|
||||
void TestDepGraphSerialization(const Cluster<SetType>& cluster, const std::string& hexenc)
|
||||
void TestDepGraphSerialization(const std::vector<std::pair<FeeFrac, SetType>>& cluster, const std::string& hexenc)
|
||||
{
|
||||
DepGraph depgraph(cluster);
|
||||
|
||||
// Run normal sanity and correspondence checks, which includes a round-trip test.
|
||||
VerifyDepGraphFromCluster(cluster, depgraph);
|
||||
|
||||
// Remove holes (which are expected to be present as HOLE entries in cluster).
|
||||
// Construct DepGraph from cluster argument.
|
||||
DepGraph<SetType> depgraph;
|
||||
SetType holes;
|
||||
for (ClusterIndex i = 0; i < cluster.size(); ++i) {
|
||||
depgraph.AddTransaction(cluster[i].first);
|
||||
if (cluster[i] == HOLE) holes.Set(i);
|
||||
}
|
||||
for (ClusterIndex i = 0; i < cluster.size(); ++i) {
|
||||
depgraph.AddDependencies(cluster[i].second, i);
|
||||
}
|
||||
depgraph.RemoveTransactions(holes);
|
||||
|
||||
// There may be multiple serializations of the same graph, but DepGraphFormatter's serializer
|
||||
|
||||
Reference in New Issue
Block a user