Skip to content

Commit

Permalink
refactor(example): early error if RPC_URL isn't set in price_printer
Browse files Browse the repository at this point in the history
  • Loading branch information
zizou0x committed Jan 7, 2025
1 parent 1b510fe commit 6059e13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/price_printer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ async fn main() {
let tycho_api_key: String =
env::var("TYCHO_API_KEY").unwrap_or_else(|_| "sampletoken".to_string());

// Perform an early check to ensure `RPC_URL` is set.
// This prevents errors from occurring later during UI interactions.
// Can be commented out if only using the example with uniswap_v2 and uniswap_v3.
env::var("RPC_URL").expect("RPC_URL env variable should be set");

// Create communication channels for inter-thread communication
let (tick_tx, tick_rx) = mpsc::channel::<BlockUpdate>(12);

Expand Down

0 comments on commit 6059e13

Please sign in to comment.