From fe71f93b449aa4fd49efe67e6e6c21e8619cfe2e Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Wed, 27 Mar 2024 21:52:02 -0400 Subject: [PATCH] update ship_streamer_test to use get_blocks_result_v1 or get_blocks_result_v0 based on finality_data_history argument --- tests/ship_streamer_test.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/ship_streamer_test.py b/tests/ship_streamer_test.py index 4f4719efc9..eb5e53242c 100755 --- a/tests/ship_streamer_test.py +++ b/tests/ship_streamer_test.py @@ -211,11 +211,14 @@ def getLatestSnapshot(nodeId): block_num = start_block_num for i in data: # fork can cause block numbers to be repeated - this_block_num = i['get_blocks_result_v0']['this_block']['block_num'] + this_block_num = i['get_blocks_result_v1']['this_block']['block_num'] if args.finality_data_history else i['get_blocks_result_v0']['this_block']['block_num'] if this_block_num < block_num: block_num = this_block_num assert block_num == this_block_num, f"{block_num} != {this_block_num}" - assert isinstance(i['get_blocks_result_v0']['block'], str) # verify block in result + if args.finality_data_history: + assert isinstance(i['get_blocks_result_v1']['block'], str) # verify block in result + else: + assert isinstance(i['get_blocks_result_v0']['block'], str) # verify block in result block_num += 1 assert block_num-1 == end_block_num, f"{block_num-1} != {end_block_num}" @@ -268,11 +271,14 @@ def getLatestSnapshot(nodeId): block_num = start_block_num for i in data: # fork can cause block numbers to be repeated - this_block_num = i['get_blocks_result_v0']['this_block']['block_num'] + this_block_num = i['get_blocks_result_v1']['this_block']['block_num'] if args.finality_data_history else i['get_blocks_result_v0']['this_block']['block_num'] if this_block_num < block_num: block_num = this_block_num assert block_num == this_block_num, f"{block_num} != {this_block_num}" - assert isinstance(i['get_blocks_result_v0']['deltas'], str) # verify deltas in result + if args.finality_data_history: + assert isinstance(i['get_blocks_result_v1']['deltas'], str) # verify deltas in result + else: + assert isinstance(i['get_blocks_result_v0']['deltas'], str) # verify deltas in result block_num += 1 assert block_num-1 == end_block_num, f"{block_num-1} != {end_block_num}"