Skip to content

Commit

Permalink
docs for roles_logic_sv2::common_properties
Browse files Browse the repository at this point in the history
  • Loading branch information
plebhash committed Nov 22, 2024
1 parent 76953c5 commit 8b783d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions protocols/v2/roles-logic-sv2/src/common_properties.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Traits that implements very basic properties that every implementation should use
//! This module defines traits for properties that every SRI-based application should implement
use crate::selectors::{
DownstreamMiningSelector, DownstreamSelector, NullDownstreamMiningSelector,
};
Expand All @@ -24,7 +25,7 @@ pub struct PairSettings {
pub flags: u32,
}

/// A trait that defines the basic properties of an upstream node.
/// General properties that every Sv2 compatible upstream node must implement.
pub trait IsUpstream<Down: IsDownstream, Sel: DownstreamSelector<Down> + ?Sized> {
/// Used to bitcoin protocol version for the channel.
fn get_version(&self) -> u16;
Expand Down Expand Up @@ -75,7 +76,7 @@ pub struct StandardChannel {
pub extranonce: Extranonce,
}

/// General properties that every Sv2 compatible mining upstream nodes must implement.
/// General properties that every Sv2 compatible mining upstream node must implement.
pub trait IsMiningUpstream<Down: IsMiningDownstream, Sel: DownstreamMiningSelector<Down> + ?Sized>:
IsUpstream<Down, Sel>
{
Expand All @@ -89,11 +90,12 @@ pub trait IsMiningUpstream<Down: IsMiningDownstream, Sel: DownstreamMiningSelect
}
}

/// General properties that every Sv2 compatible mining downstream nodes must implement.
/// General properties that every Sv2 compatible downstream node must implement.
pub trait IsDownstream {
fn get_downstream_mining_data(&self) -> CommonDownstreamData;
}

/// General properties that every Sv2 compatible mining downstream node must implement.
pub trait IsMiningDownstream: IsDownstream {
fn is_header_only(&self) -> bool {
self.get_downstream_mining_data().header_only
Expand Down

0 comments on commit 8b783d4

Please sign in to comment.