From 560b7f4b43320ee8a69bbb772ffe5acd2d9d69b4 Mon Sep 17 00:00:00 2001 From: yperbasis Date: Wed, 3 Jan 2024 17:43:02 +0100 Subject: [PATCH] assert -> static_assert --- silkworm/sentry/grpc/interfaces/eth_version.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/silkworm/sentry/grpc/interfaces/eth_version.cpp b/silkworm/sentry/grpc/interfaces/eth_version.cpp index 429d660688..8cfd2fb519 100644 --- a/silkworm/sentry/grpc/interfaces/eth_version.cpp +++ b/silkworm/sentry/grpc/interfaces/eth_version.cpp @@ -21,12 +21,12 @@ namespace silkworm::sentry::grpc::interfaces { namespace proto = ::sentry; uint8_t eth_version_from_protocol(proto::Protocol protocol) { - assert(proto::Protocol_MIN == proto::Protocol::ETH65); + static_assert(proto::Protocol_MIN == proto::Protocol::ETH65); return static_cast(protocol) + 65; } proto::Protocol protocol_from_eth_version(uint8_t version) { - assert(proto::Protocol_MIN == proto::Protocol::ETH65); + static_assert(proto::Protocol_MIN == proto::Protocol::ETH65); return static_cast(version - 65); }