Skip to content

Commit fbdd8fa

Browse files
committed
docs: monitor types
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent de65ec9 commit fbdd8fa

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

crates/monitor/src/allocations.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::{
1212
};
1313
use tokio::sync::watch::Receiver;
1414

15+
/// Receiver of Map between allocation id and allocation struct
1516
pub type AllocationWatcher = Receiver<HashMap<Address, Allocation>>;
1617

1718
/// An always up-to-date list of an indexer's active and recently closed allocations.

crates/monitor/src/attestation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use thegraph_core::{Address, ChainId};
1111
use tokio::sync::watch::Receiver;
1212
use tracing::warn;
1313

14+
/// Receiver for Map of allocation id and attestation signer
1415
pub type AttestationWatcher = Receiver<HashMap<Address, AttestationSigner>>;
1516

1617
/// An always up-to-date list of attestation signers, one for each of the indexer's allocations.

crates/monitor/src/deployment_to_allocation.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ use std::collections::HashMap;
55
use thegraph_core::{Address, DeploymentId};
66
use tokio::sync::watch::Receiver;
77

8-
use indexer_allocation::Allocation;
98
use indexer_watcher::map_watcher;
109

10+
use crate::AllocationWatcher;
11+
12+
/// Watcher for Map of deployment id and allocation id
1113
pub type DeploymentToAllocationWatcher = Receiver<HashMap<DeploymentId, Address>>;
1214

1315
/// Watcher of indexer allocation
1416
/// returning a map of subgraph deployment to allocation id
1517
pub fn deployment_to_allocation(
16-
indexer_allocations_rx: Receiver<HashMap<Address, Allocation>>,
18+
indexer_allocations_rx: AllocationWatcher,
1719
) -> DeploymentToAllocationWatcher {
1820
map_watcher(indexer_allocations_rx, move |allocation| {
1921
allocation

crates/monitor/src/dispute_manager.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ use indexer_watcher::new_watcher;
99
use std::time::Duration;
1010
use tokio::sync::watch::Receiver;
1111

12+
/// Watcher for Dispute Manager Address
1213
pub type DisputeManagerWatcher = Receiver<Address>;
1314

15+
/// Monitors the subgraph for dispute manager address
1416
pub async fn dispute_manager(
1517
network_subgraph: &'static SubgraphClient,
1618
interval: Duration,

0 commit comments

Comments
 (0)