From a72eab76d9789085d5adac90cc7b3a5b181bf97a Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Thu, 12 Oct 2023 13:00:58 +0200 Subject: [PATCH] fix getting genesis in graphql --- CMakeLists.txt | 2 +- libraries/core_libs/network/graphql/src/query.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fec49b5f0d..b5cbe0c125 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.20) # Set current version of the project set(TARAXA_MAJOR_VERSION 1) set(TARAXA_MINOR_VERSION 4) -set(TARAXA_PATCH_VERSION 8) +set(TARAXA_PATCH_VERSION 9) set(TARAXA_VERSION ${TARAXA_MAJOR_VERSION}.${TARAXA_MINOR_VERSION}.${TARAXA_PATCH_VERSION}) # Any time a change in the network protocol is introduced this version should be increased diff --git a/libraries/core_libs/network/graphql/src/query.cpp b/libraries/core_libs/network/graphql/src/query.cpp index a64245a567..e8705353e4 100644 --- a/libraries/core_libs/network/graphql/src/query.cpp +++ b/libraries/core_libs/network/graphql/src/query.cpp @@ -52,6 +52,12 @@ std::shared_ptr Query::getBlock(std::optional&& return nullptr; } + // Special case for genesis + if (block_number == 0) [[unlikely]] { + return std::make_shared(std::make_shared( + final_chain_, transaction_manager_, get_block_by_num_, ::taraxa::blk_hash_t(), block_header)); + } + auto pbft_block = db_->getPbftBlock(block_header->number); if (!pbft_block) { // shouldn't be possible