From 2cece613272ed1dd71b9b8496ae31211755f47e3 Mon Sep 17 00:00:00 2001 From: lupin012 <58134934+lupin012@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:57:58 +0200 Subject: [PATCH] rpcdaemon: add safe and finalized blocks in BlockNumberOrHash (#1984) --- silkworm/rpc/types/block.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/silkworm/rpc/types/block.cpp b/silkworm/rpc/types/block.cpp index 79daa0915e..e7fa65fe54 100644 --- a/silkworm/rpc/types/block.cpp +++ b/silkworm/rpc/types/block.cpp @@ -89,6 +89,10 @@ void BlockNumberOrHash::build(const std::string& bnoh) { value_ = core::kEarliestBlockNumber; } else if (bnoh == core::kLatestBlockId || bnoh == core::kPendingBlockId) { value_ = bnoh; + } else if (bnoh == core::kFinalizedBlockId) { + value_ = bnoh; + } else if (bnoh == core::kSafeBlockId) { + value_ = bnoh; } else if (absl::StartsWithIgnoreCase(bnoh, "0x")) { if (bnoh.length() == 66) { const auto b32_bytes = silkworm::from_hex(bnoh);