Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
feat(chain): expose SectionChain via API
Browse files Browse the repository at this point in the history
  • Loading branch information
oetyng authored and joshuef committed Mar 22, 2021
1 parent e78aa7e commit 1590414
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/routing/approved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ impl Approved {
Ok(Self::new(node, section, Some(section_key_share), event_tx))
}

pub fn section_chain(&self) -> SectionChain {
self.section.chain().clone()
}

// Creates the approved state for a regular node.
pub fn new(
node: Node,
Expand Down
5 changes: 5 additions & 0 deletions src/routing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ impl Routing {
self.stage.comm.our_connection_info()
}

/// Returns the Section Proof Chain
pub async fn section_chain(&self) -> SectionChain {
self.stage.state.lock().await.section_chain()
}

/// Prefix of our section
pub async fn our_prefix(&self) -> Prefix {
*self.stage.state.lock().await.section().prefix()
Expand Down

0 comments on commit 1590414

Please sign in to comment.