Skip to content

Commit

Permalink
improved integration test for get_v3_block_by_height
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeioris committed Nov 14, 2024
1 parent fc0d293 commit b931bbb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion testnet/stacks-node/src/tests/nakamoto_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9405,8 +9405,16 @@ fn v3_blockbyheight_api_endpoint() {

let block_height = tip.stacks_block_height;
let block_data = get_v3_block_by_height(block_height);

assert!(block_data.status().is_success());
assert!(block_data.bytes().unwrap().len() > 0);
let block_bytes_vec = block_data.bytes().unwrap().to_vec();
assert!(block_bytes_vec.len() > 0);

// does the block id of the returned blob matches ?
let block_id = NakamotoBlockHeader::consensus_deserialize(&mut block_bytes_vec.as_slice())
.unwrap()
.block_id();
assert_eq!(block_id, tip.index_block_hash());

info!("------------------------- Test finished, clean up -------------------------");

Expand Down

0 comments on commit b931bbb

Please sign in to comment.