Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix getting genesis in graphql #2584

Merged
merged 1 commit into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions libraries/core_libs/network/graphql/src/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ std::shared_ptr<object::Block> Query::getBlock(std::optional<response::Value>&&
return nullptr;
}

// Special case for genesis
if (block_number == 0) [[unlikely]] {
return std::make_shared<object::Block>(std::make_shared<Block>(
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
Expand Down
Loading