File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
testnet/stacks-node/src/tests Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -9407,8 +9407,16 @@ fn v3_blockbyheight_api_endpoint() {
9407
9407
9408
9408
let block_height = tip. stacks_block_height ;
9409
9409
let block_data = get_v3_block_by_height ( block_height) ;
9410
+
9410
9411
assert ! ( block_data. status( ) . is_success( ) ) ;
9411
- assert ! ( block_data. bytes( ) . unwrap( ) . len( ) > 0 ) ;
9412
+ let block_bytes_vec = block_data. bytes ( ) . unwrap ( ) . to_vec ( ) ;
9413
+ assert ! ( block_bytes_vec. len( ) > 0 ) ;
9414
+
9415
+ // does the block id of the returned blob matches ?
9416
+ let block_id = NakamotoBlockHeader :: consensus_deserialize ( & mut block_bytes_vec. as_slice ( ) )
9417
+ . unwrap ( )
9418
+ . block_id ( ) ;
9419
+ assert_eq ! ( block_id, tip. index_block_hash( ) ) ;
9412
9420
9413
9421
info ! ( "------------------------- Test finished, clean up -------------------------" ) ;
9414
9422
You can’t perform that action at this time.
0 commit comments