20#ifndef RIPPLE_TEST_CSF_UNL_H_INCLUDED
21#define RIPPLE_TEST_CSF_UNL_H_INCLUDED
23#include <test/csf/random.h>
24#include <boost/container/flat_set.hpp>
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});
bool connected(Vertex source, Vertex target) const
Check if two vertices are connected.
auto outVertices() const
Range over vertices in the graph.
bool disconnect(Vertex source, Vertex target)
Disconnect two vertices.
bool connect(Vertex source, Vertex target, EdgeData e)
Connect two vertices.
void trust(Peer const &from, Peer const &to)
Create trust.
bool canFork(double quorum) const
Check whether this trust graph satisfies the whitepaper no-forking condition.
void untrust(Peer const &from, Peer const &to)
Remove trust.
std::vector< ForkInfo > forkablePairs(double quorum) const
auto trustedPeers(Peer const &a) const
Range over trusted peers.
bool trusts(Peer const &from, Peer const &to) const
TrustGraph()=default
Create an empty trust graph.
T emplace_back(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
A single peer in the simulation.
An example of nodes that fail the whitepaper no-forking condition.