diff --git a/web3_proxy_cli/tests/test_proxy.rs b/web3_proxy_cli/tests/test_proxy.rs index 858dbe8b..6beec325 100644 --- a/web3_proxy_cli/tests/test_proxy.rs +++ b/web3_proxy_cli/tests/test_proxy.rs @@ -81,14 +81,17 @@ async fn it_starts_and_stops() { let mut proxy_result = None; for _ in 0..10 { - proxy_result = proxy_provider + // TODO: we currently give a 502 here when we should give a `None` + if let Ok(x) = proxy_provider .request::<_, Option>("eth_getBlockByNumber", ("latest", false)) .await - .unwrap(); + { + proxy_result = x; - if let Some(ref proxy_result) = proxy_result { - if proxy_result.number == Some(second_block_num) { - break; + if let Some(ref proxy_result) = proxy_result { + if proxy_result.number == Some(second_block_num) { + break; + } } } @@ -97,7 +100,7 @@ async fn it_starts_and_stops() { sleep(Duration::from_millis(100)).await; } - assert_eq!(anvil_result, proxy_result.unwrap()); + assert_eq!(Some(anvil_result), proxy_result); // this won't do anything since stats aren't tracked when there isn't a db let flushed = x.flush_stats_and_wait().await.unwrap();