From f275805198ace110a81559d8d9c4bde7907f41da Mon Sep 17 00:00:00 2001 From: Kim De Mey Date: Wed, 5 Jun 2024 19:44:26 +0200 Subject: [PATCH] Set styleCheck to error for nimbus_verified_proxy + some cleanup (#2297) --- nimbus_verified_proxy/nim.cfg | 2 +- nimbus_verified_proxy/nimbus_verified_proxy.nim | 6 +++--- nimbus_verified_proxy/rpc/rpc_utils.nim | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nimbus_verified_proxy/nim.cfg b/nimbus_verified_proxy/nim.cfg index cd02861e0..7d02f7be6 100644 --- a/nimbus_verified_proxy/nim.cfg +++ b/nimbus_verified_proxy/nim.cfg @@ -18,6 +18,6 @@ -d:"libp2p_pki_schemes=secp256k1" --styleCheck:usages ---styleCheck:hint +--styleCheck:error --hint[ConvFromXtoItselfNotNeeded]:off --hint[Processing]:off diff --git a/nimbus_verified_proxy/nimbus_verified_proxy.nim b/nimbus_verified_proxy/nimbus_verified_proxy.nim index 76018e6ed..7bc90cb9e 100644 --- a/nimbus_verified_proxy/nimbus_verified_proxy.nim +++ b/nimbus_verified_proxy/nimbus_verified_proxy.nim @@ -8,7 +8,7 @@ {.push raises: [].} import - std/[atomics, json, os, strutils], + std/[json, os, strutils], chronicles, chronos, confutils, @@ -204,7 +204,7 @@ proc run*( info "New LC finalized header", finalized_header = shortLog(forkyHeader) if headerCallback != nil: try: - headerCallback(Json.encode(forkyHeader), 0) + headerCallback(cstring(Json.encode(forkyHeader)), 0) except SerializationError as e: notice "finalizedHeaderCallback exception" @@ -217,7 +217,7 @@ proc run*( optimisticProcessor.setOptimisticHeader(forkyHeader.beacon) if headerCallback != nil: try: - headerCallback(Json.encode(forkyHeader), 1) + headerCallback(cstring(Json.encode(forkyHeader)), 1) except SerializationError as e: notice "optimisticHeaderCallback exception" diff --git a/nimbus_verified_proxy/rpc/rpc_utils.nim b/nimbus_verified_proxy/rpc/rpc_utils.nim index a79e3d249..3ac274377 100644 --- a/nimbus_verified_proxy/rpc/rpc_utils.nim +++ b/nimbus_verified_proxy/rpc/rpc_utils.nim @@ -9,7 +9,6 @@ import std/typetraits, - chronicles, # Added for generic sandwich that hits in core_db :( eth/common/eth_types as etypes, eth/[trie, rlp], stint,