Skip to content

Commit

Permalink
assert -> static_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis committed Jan 3, 2024
1 parent 7653ef0 commit 560b7f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions silkworm/sentry/grpc/interfaces/eth_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>(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<proto::Protocol>(version - 65);
}

Expand Down

0 comments on commit 560b7f4

Please sign in to comment.