Skip to content

Commit 7c66cf1

Browse files
committed
Add integration test for get_block_hash()
1 parent a0f1aca commit 7c66cf1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,19 @@ mod test {
545545
assert_eq!(tip_hash, tip_hash_async);
546546
}
547547

548+
#[cfg(all(feature = "blocking", any(feature = "async", feature = "async-https")))]
549+
#[tokio::test]
550+
async fn test_get_block_hash() {
551+
let (blocking_client, async_client) = setup_clients().await;
552+
553+
let block_hash = BITCOIND.client.get_block_hash(21).unwrap();
554+
555+
let block_hash_blocking = blocking_client.get_block_hash(21).unwrap();
556+
let block_hash_async = async_client.get_block_hash(21).await.unwrap();
557+
assert_eq!(block_hash, block_hash_blocking);
558+
assert_eq!(block_hash, block_hash_async);
559+
}
560+
548561
#[cfg(all(feature = "blocking", any(feature = "async", feature = "async-https")))]
549562
#[tokio::test]
550563
async fn test_get_txid_at_block_index() {

0 commit comments

Comments
 (0)