Skip to content

Commit

Permalink
Error message reminder
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAWM committed Sep 9, 2023
1 parent 89efa7a commit 806cd89
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/evm/onchain/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,11 @@ impl OnChainConfig {
}
};

assert!(
result.len() == 196,
"Unexpected RPC error, consider setting env <ETH_RPC_URL> "
);

let reserve1 = &result[3..67];
let reserve2 = &result[67..131];

Expand Down Expand Up @@ -981,7 +986,11 @@ impl OnChainConfig {
src_exact: "".to_string(),
};
}
let mut peg_info = self.get_pair(token, network, true).get(0).unwrap().clone();
let mut peg_info = self
.get_pair(token, network, true)
.get(0)
.expect("Unexpected RPC error, consider setting env <ETH_RPC_URL> ")
.clone();

self.add_reserve_info(&mut peg_info, block);
let p0 = i128::from_str_radix(&peg_info.initial_reserves_0, 16).unwrap();
Expand Down

0 comments on commit 806cd89

Please sign in to comment.