MCPcopy Create free account
hub / github.com/SeismicSystems/summit / join_validator

Function join_validator

node/src/test_harness/common.rs:73–95  ·  view source on GitHub ↗
(
    oracle: &mut Oracle<PublicKey, E>,
    validator: &PublicKey,
    existing_validators: &[PublicKey],
    link: Link,
)

Source from the content-addressed store, hash-verified

71 .await
72 .unwrap();
73 }
74 }
75}
76
77pub async fn join_validator<E: Clock>(
78 oracle: &mut Oracle<PublicKey, E>,
79 validator: &PublicKey,
80 existing_validators: &[PublicKey],
81 link: Link,
82) {
83 for existing in existing_validators {
84 // Skip self
85 if existing == validator {
86 continue;
87 }
88
89 // Add links in both directions
90 oracle
91 .add_link(validator.clone(), existing.clone(), link.clone())
92 .await
93 .unwrap();
94 oracle
95 .add_link(existing.clone(), validator.clone(), link.clone())
96 .await
97 .unwrap();
98 }

Calls

no outgoing calls