From 446e4c98556791f0d08acf1aa82d3113e7acc543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Est=C3=A9fano=20Bargas?= Date: Mon, 2 Dec 2024 13:18:17 -0300 Subject: [PATCH] add test --- crates/l2/prover/bench/src/lib.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crates/l2/prover/bench/src/lib.rs b/crates/l2/prover/bench/src/lib.rs index c4565f1be..06ff34e27 100644 --- a/crates/l2/prover/bench/src/lib.rs +++ b/crates/l2/prover/bench/src/lib.rs @@ -107,3 +107,32 @@ pub async fn get_account( .map_err(|_| "failed to parse code hash".to_string())?, }) } + +#[cfg(test)] +mod test { + use ethrex_core::Address; + + use crate::{get_account, get_block}; + + const BLOCK_NUMBER: usize = 21315830; + const RPC_URL: &str = ""; + const VITALIK_ADDR: &str = "d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; + + #[ignore = "Needs to manually set RPC_URL"] + #[tokio::test] + async fn get_block_works() { + get_block(RPC_URL, BLOCK_NUMBER).await.unwrap(); + } + + #[ignore = "Needs to manually set RPC_URL"] + #[tokio::test] + async fn get_account_works() { + get_account( + RPC_URL, + BLOCK_NUMBER, + Address::from_slice(&hex::decode(VITALIK_ADDR).unwrap()), + ) + .await + .unwrap(); + } +}