rippled
Classes | Public Member Functions | Private Types | Private Attributes | List of all members
ripple::test::csf::TrustGraph< Peer > Class Template Reference

Trust graph. More...

Collaboration diagram for ripple::test::csf::TrustGraph< Peer >:
Collaboration graph
[legend]

Classes

struct  ForkInfo
 An example of nodes that fail the whitepaper no-forking condition. More...
 

Public Member Functions

 TrustGraph ()=default
 Create an empty trust graph. More...
 
Graph const & graph ()
 
void trust (Peer const &from, Peer const &to)
 Create trust. More...
 
void untrust (Peer const &from, Peer const &to)
 Remove trust. More...
 
bool trusts (Peer const &from, Peer const &to) const
 
auto trustedPeers (Peer const &a) const
 Range over trusted peers. More...
 
std::vector< ForkInfoforkablePairs (double quorum) const
 
bool canFork (double quorum) const
 Check whether this trust graph satisfies the whitepaper no-forking condition. More...
 

Private Types

using Graph = Digraph< Peer >
 

Private Attributes

Graph graph_
 

Detailed Description

template<class Peer>
class ripple::test::csf::TrustGraph< Peer >

Trust graph.

Trust is a directed relationship from a node i to node j. If node i trusts node j, then node i has node j in its UNL. This class wraps a digraph representing the trust relationships for all peers in the simulation.

Definition at line 43 of file TrustGraph.h.

Member Typedef Documentation

◆ Graph

template<class Peer >
using ripple::test::csf::TrustGraph< Peer >::Graph = Digraph<Peer>
private

Definition at line 45 of file TrustGraph.h.

Constructor & Destructor Documentation

◆ TrustGraph()

template<class Peer >
ripple::test::csf::TrustGraph< Peer >::TrustGraph ( )
default

Create an empty trust graph.

Member Function Documentation

◆ graph()

template<class Peer >
Graph const& ripple::test::csf::TrustGraph< Peer >::graph ( )

Definition at line 55 of file TrustGraph.h.

◆ trust()

template<class Peer >
void ripple::test::csf::TrustGraph< Peer >::trust ( Peer const &  from,
Peer const &  to 
)

Create trust.

Establish trust between Peer from and Peer to; as if from put to in its UNL.

Parameters
fromThe peer granting trust
toThe peer receiving trust

Definition at line 70 of file TrustGraph.h.

◆ untrust()

template<class Peer >
void ripple::test::csf::TrustGraph< Peer >::untrust ( Peer const &  from,
Peer const &  to 
)

Remove trust.

Revoke trust from Peer from to Peer to; as if from removed to from its UNL.

Parameters
fromThe peer revoking trust
toThe peer being revoked

Definition at line 84 of file TrustGraph.h.

◆ trusts()

template<class Peer >
bool ripple::test::csf::TrustGraph< Peer >::trusts ( Peer const &  from,
Peer const &  to 
) const

Definition at line 91 of file TrustGraph.h.

◆ trustedPeers()

template<class Peer >
auto ripple::test::csf::TrustGraph< Peer >::trustedPeers ( Peer const &  a) const

Range over trusted peers.

Parameters
aThe node granting trust
Returns
boost transformed range over nodes a trusts, i.e. the nodes in its UNL

Definition at line 103 of file TrustGraph.h.

◆ forkablePairs()

template<class Peer >
std::vector<ForkInfo> ripple::test::csf::TrustGraph< Peer >::forkablePairs ( double  quorum) const

Definition at line 120 of file TrustGraph.h.

◆ canFork()

template<class Peer >
bool ripple::test::csf::TrustGraph< Peer >::canFork ( double  quorum) const

Check whether this trust graph satisfies the whitepaper no-forking condition.

Definition at line 167 of file TrustGraph.h.

Member Data Documentation

◆ graph_

template<class Peer >
Graph ripple::test::csf::TrustGraph< Peer >::graph_
private

Definition at line 47 of file TrustGraph.h.