Skip to content

Commit

Permalink
chore(fortuna): make fortuna a library crate (#2373)
Browse files Browse the repository at this point in the history
* make fortuna a lib

* refactor(fortuna): streamline module imports in main.rs
  • Loading branch information
cctdaniel authored Feb 12, 2025
1 parent 48223c1 commit c7ca8f0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
4 changes: 4 additions & 0 deletions apps/fortuna/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name = "fortuna"
version = "7.4.1"
edition = "2021"

[lib]
name = "fortuna"
path = "src/lib.rs"

[dependencies]
anyhow = "1.0.75"
axum = { version = "0.6.20", features = ["json", "ws", "macros"] }
Expand Down
4 changes: 2 additions & 2 deletions apps/fortuna/src/chain.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pub(crate) mod ethereum;
pub(crate) mod reader;
pub mod ethereum;
pub mod reader;
2 changes: 1 addition & 1 deletion apps/fortuna/src/command/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub async fn run_keeper(
rpc_metrics: Arc<RpcMetrics>,
) -> Result<()> {
let mut handles = Vec::new();
let keeper_metrics = Arc::new({
let keeper_metrics: Arc<KeeperMetrics> = Arc::new({
let chain_labels: Vec<(String, Address)> = chains
.iter()
.map(|(id, state)| (id.clone(), state.provider_address))
Expand Down
7 changes: 7 additions & 0 deletions apps/fortuna/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pub mod api;
pub mod chain;
pub mod command;
pub mod config;
pub mod eth_utils;
pub mod keeper;
pub mod state;
15 changes: 6 additions & 9 deletions apps/fortuna/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#![allow(clippy::just_underscores_and_digits)]

use {anyhow::Result, clap::Parser, std::io::IsTerminal};

pub mod api;
pub mod chain;
pub mod command;
pub mod config;
pub mod eth_utils;
pub mod keeper;
pub mod state;
use {
anyhow::Result,
clap::Parser,
fortuna::{command, config},
std::io::IsTerminal,
};

// Server TODO list:
// - Tests
Expand Down

0 comments on commit c7ca8f0

Please sign in to comment.