Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
xqft committed Dec 2, 2024
1 parent 11f35ac commit 446e4c9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions crates/l2/prover/bench/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<to complete>";
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();
}
}

0 comments on commit 446e4c9

Please sign in to comment.