Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
segfault-magnet committed May 6, 2024
1 parent 65dc49c commit 7e8d07e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/eth/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ethers::{
};

#[derive(Debug, thiserror::Error)]
pub(crate) enum Error {
pub enum Error {
#[error("wallet error: {0}")]
Wallet(#[from] ethers::signers::WalletError),
#[error("network error: {0}")]
Expand All @@ -20,7 +20,7 @@ impl From<ethers::providers::ProviderError> for Error {
}
}

pub(crate) type ContractErrorType =
pub type ContractErrorType =
ethers::contract::ContractError<SignerMiddleware<Provider<Ws>, LocalWallet>>;

impl From<ContractErrorType> for Error {
Expand All @@ -33,7 +33,7 @@ impl From<ContractErrorType> for Error {
}
}

pub(crate) type Result<T> = std::result::Result<T, Error>;
pub type Result<T> = std::result::Result<T, Error>;

impl From<Error> for ports::l1::Error {
fn from(err: Error) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion packages/eth/src/websocket/health_tracking_middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{

#[cfg_attr(test, mockall::automock)]
#[async_trait::async_trait]
pub(crate) trait EthApi {
pub trait EthApi {
async fn submit(&self, block: FuelBlock) -> Result<()>;
async fn get_block_number(&self) -> Result<u64>;
async fn balance(&self) -> Result<U256>;
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use metrics::{
RegistersMetrics,
};

pub(crate) struct Metrics {
pub struct Metrics {
pub fuel_network_errors: IntCounter,
}

Expand Down
2 changes: 2 additions & 0 deletions packages/services/src/health_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ pub struct HealthReporter {
}

impl HealthReporter {
#[must_use]
pub fn new(fuel_health_check: HealthChecker, eth_health_check: HealthChecker) -> Self {
Self {
fuel_connection: fuel_health_check,
eth_connection: eth_health_check,
}
}

#[must_use]
pub fn report(&self) -> HealthReport {
HealthReport {
fuel_connection_up: self.fuel_connection.healthy(),
Expand Down
10 changes: 5 additions & 5 deletions packages/storage/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
pub(crate) type Result<T> = std::result::Result<T, Error>;
pub type Result<T> = std::result::Result<T, Error>;

#[derive(Debug, thiserror::Error)]
pub(crate) enum Error {
pub enum Error {
#[error("Database Error {0}")]
Database(String),
#[error("Could not convert to/from domain/db type {0}")]
Conversion(String),
}

impl From<Error> for ports::storage::Error {
fn from(value: Error) -> ports::storage::Error {
fn from(value: Error) -> Self {
match value {
Error::Database(e) => ports::storage::Error::Database(e),
Error::Conversion(e) => ports::storage::Error::Conversion(e),
Error::Database(e) => Self::Database(e),
Error::Conversion(e) => Self::Conversion(e),
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/storage/src/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ pub struct Postgres {

#[derive(Debug, Clone, serde::Deserialize)]
pub struct DbConfig {
/// The hostname or IP address of the PostgreSQL server.
/// The hostname or IP address of the `PostgreSQL` server.
pub host: String,
/// The port number on which the PostgreSQL server is listening.
/// The port number on which the `PostgreSQL` server is listening.
pub port: u16,
/// The username used to authenticate with the PostgreSQL server.
/// The username used to authenticate with the `PostgreSQL` server.
pub username: String,
/// The password used to authenticate with the PostgreSQL server.
/// The password used to authenticate with the `PostgreSQL` server.
pub password: String,
/// The name of the database to connect to on the PostgreSQL server.
/// The name of the database to connect to on the `PostgreSQL` server.
pub database: String,
/// The maximum number of connections allowed in the connection pool.
pub max_connections: u32,
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/src/tables.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ports::types::{BlockSubmission, FuelBlock};

#[derive(sqlx::FromRow)]
pub(crate) struct L1FuelBlockSubmission {
pub struct L1FuelBlockSubmission {
pub fuel_block_hash: Vec<u8>,
pub fuel_block_height: i64,
pub completed: bool,
Expand Down

0 comments on commit 7e8d07e

Please sign in to comment.