Skip to content

Commit

Permalink
Merge pull request #151 from rustaceanrob/alias-09-30
Browse files Browse the repository at this point in the history
feat: add type alias for `Node` in `builder`
  • Loading branch information
rustaceanrob authored Sep 30, 2024
2 parents ba0062a + e088308 commit cccbe07
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ use crate::{
};
use crate::{ConnectionType, TrustedPeer};

#[cfg(feature = "database")]
/// The default node returned from the [`NodeBuilder`](crate::core).
pub type NodeDefault = Node<SqliteHeaderDb, SqlitePeerDb>;

/// Build a [`Node`] in an additive way.
///
/// # Examples
Expand Down Expand Up @@ -153,9 +157,7 @@ impl NodeBuilder {
///
/// Building a node and client will error if a database connection is denied or cannot be found.
#[cfg(feature = "database")]
pub fn build_node(
&mut self,
) -> Result<(Node<SqliteHeaderDb, SqlitePeerDb>, Client), SqlInitializationError> {
pub fn build_node(&mut self) -> Result<(NodeDefault, Client), SqlInitializationError> {
let peer_store = SqlitePeerDb::new(self.network, self.config.data_path.clone())?;
let header_store = SqliteHeaderDb::new(self.network, self.config.data_path.clone())?;
Ok(Node::new_from_config(
Expand Down

0 comments on commit cccbe07

Please sign in to comment.