use alloy::primitives::Address;
use polyoxide_relay::RelayClient;
use std::time::Duration;
fn client() -> RelayClient {
RelayClient::builder()
.expect("default builder URL is valid")
.build()
.expect("relay client should build without account")
}
#[tokio::test]
#[ignore]
async fn live_ping() {
let client = client();
let latency = client.ping().await.expect("ping should succeed");
assert!(
latency < Duration::from_secs(10),
"latency too high: {:?}",
latency
);
}
#[tokio::test]
#[ignore]
async fn live_get_deployed_zero_address() {
let client = client();
let deployed = client
.get_deployed(Address::ZERO)
.await
.expect("get_deployed should succeed for zero address");
assert!(!deployed, "zero address should not be deployed");
}
#[tokio::test]
#[ignore]
async fn live_get_deployed_known_address() {
let addr: Address = "0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b"
.parse()
.expect("valid address");
let client = client();
let deployed = client
.get_deployed(addr)
.await
.expect("get_deployed should deserialize");
let _ = deployed;
}
#[tokio::test]
#[ignore]
async fn live_get_nonce() {
let client = client();
let nonce = client
.get_nonce(Address::ZERO)
.await
.expect("get_nonce should succeed for zero address");
assert_eq!(nonce, 0, "zero address should have nonce 0");
}