20 #ifndef RIPPLE_TEST_CSF_UNL_H_INCLUDED
21 #define RIPPLE_TEST_CSF_UNL_H_INCLUDED
23 #include <boost/container/flat_set.hpp>
24 #include <test/csf/random.h>
139 for (
int i = 0; i < uniqueUNLs.
size(); ++i)
141 for (
int j = (i + 1); j < uniqueUNLs.
size(); ++j)
143 auto const& unlA = uniqueUNLs[i];
144 auto const& unlB = uniqueUNLs[j];
146 2.0 * (1. - quorum) *
std::max(unlA.size(), unlB.size());
148 int intersectionSize =
150 return unlB.find(p) != unlB.end();
153 if (intersectionSize < rhs)
156 ForkInfo{unlA, unlB, intersectionSize, rhs});
auto outVertices() const
Range over vertices in the graph.
TrustGraph()=default
Create an empty trust graph.
void trust(Peer const &from, Peer const &to)
Create trust.
void untrust(Peer const &from, Peer const &to)
Remove trust.
An example of nodes that fail the whitepaper no-forking condition.
bool disconnect(Vertex source, Vertex target)
Disconnect two vertices.
A single peer in the simulation.
T emplace_back(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
auto trustedPeers(Peer const &a) const
Range over trusted peers.
bool canFork(double quorum) const
Check whether this trust graph satisfies the whitepaper no-forking condition.
bool connect(Vertex source, Vertex target, EdgeData e)
Connect two vertices.
bool trusts(Peer const &from, Peer const &to) const
bool connected(Vertex source, Vertex target) const
Check if two vertices are connected.
std::vector< ForkInfo > forkablePairs(double quorum) const