Skip to content

Commit

Permalink
rpcdaemon: add safe and finalized blocks in BlockNumberOrHash (#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
lupin012 authored Apr 25, 2024
1 parent 4c21489 commit 2cece61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions silkworm/rpc/types/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2cece61

Please sign in to comment.