Skip to content

Commit

Permalink
compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Feb 11, 2024
1 parent 261f8a5 commit be15846
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const MAX_SEND_AMOUNT: u64 = 10_000_000;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let state = setup().await;
let state = setup().await?;

let app = Router::new()
.route("/api/onchain", post(onchain_handler))
Expand Down
10 changes: 8 additions & 2 deletions src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use tonic_openssl_lnd::lnrpc;

use crate::AppState;

pub async fn setup() -> AppState {
pub async fn setup() -> anyhow::Result<AppState> {
// Load environment variables from various sources.
dotenv::from_filename(".env.local").ok();
dotenv::from_filename(".env").ok();
Expand Down Expand Up @@ -72,5 +72,11 @@ pub async fn setup() -> AppState {
rpc
};

AppState::new(host, keys, lightning_client, bitcoin_client, network)
Ok(AppState::new(
host,
keys,
lightning_client,
bitcoin_client,
network,
))
}

0 comments on commit be15846

Please sign in to comment.