From 840b02b2208c98030fb4ca27f5f94d2288466d60 Mon Sep 17 00:00:00 2001 From: supertypo Date: Sat, 6 Jul 2024 19:34:49 +0200 Subject: [PATCH] Fixed validation error when block.mergeSetBluesHashes or mergeSetRedsHashes is None --- endpoints/get_blocks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/endpoints/get_blocks.py b/endpoints/get_blocks.py index 5db8feb..21ff4cb 100644 --- a/endpoints/get_blocks.py +++ b/endpoints/get_blocks.py @@ -172,8 +172,8 @@ async def get_blocks_from_bluescore(response: Response, "transactionIds": [tx["verboseData"]["transactionId"] for tx in txs] if includeTransactions else None, "blueScore": block.blue_score, "childrenHashes": None, - "mergeSetBluesHashes": block.merge_set_blues_hashes, - "mergeSetRedsHashes": block.merge_set_reds_hashes, + "mergeSetBluesHashes": block.merge_set_blues_hashes or [], + "mergeSetRedsHashes": block.merge_set_reds_hashes or [], "isChainBlock": is_chain_block, } } for block, is_chain_block in blocks_cb] @@ -228,8 +228,8 @@ async def get_block_from_db(blockId): "transactionIds": None, # information not in database "blueScore": requested_block.blue_score, "childrenHashes": None, # information not in database - "mergeSetBluesHashes": requested_block.merge_set_blues_hashes, - "mergeSetRedsHashes": requested_block.merge_set_reds_hashes, + "mergeSetBluesHashes": requested_block.merge_set_blues_hashes or [], + "mergeSetRedsHashes": requested_block.merge_set_reds_hashes or [], "isChainBlock": is_chain_block, # information not in database } }