Skip to content

Commit

Permalink
Added test for Client::block (paritytech#12590)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkucharczyk authored Oct 31, 2022
1 parent 7035139 commit 07a6332
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/service/test/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,14 @@ fn finality_notifications_content() {
assert!(finality_notifications.try_next().is_err());
}

#[test]
fn get_block_by_bad_block_hash_returns_none() {
let client = substrate_test_runtime_client::new();

let hash = H256::from_low_u64_be(5);
assert!(client.block(&BlockId::Hash(hash)).unwrap().is_none());
}

#[test]
fn get_header_by_block_number_doesnt_panic() {
let client = substrate_test_runtime_client::new();
Expand Down

0 comments on commit 07a6332

Please sign in to comment.