Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tonypony220 committed Jun 22, 2024
1 parent 7247758 commit 951e57a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions crates/starknet-devnet/tests/test_get_block_txs_count.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pub mod common;

mod get_block_txs_count_tests {

use starknet_rs_core::types::{BlockId, BlockTag, StarknetError};
use starknet_rs_providers::{Provider, ProviderError};

use crate::common::background_devnet::BackgroundDevnet;

#[tokio::test]
async fn test_invalid_block() {
let devnet = BackgroundDevnet::spawn().await.expect("Could not start Devnet");

let res = devnet
.json_rpc_client
.get_block_transaction_count(BlockId::Number(9000000000))
.await
.unwrap_err();
match res {
ProviderError::StarknetError(StarknetError::BlockNotFound) => (),
_ => panic!("Invalid error: {res:?}"),
}
}

#[tokio::test]
async fn test_valid_block() {
let devnet = BackgroundDevnet::spawn().await.expect("Could not start Devnet");

devnet
.json_rpc_client
.get_block_transaction_count(BlockId::Tag(BlockTag::Latest))
.await
.unwrap();
}
}

0 comments on commit 951e57a

Please sign in to comment.