From 719c0dfd56c14814379d2f1c400df8dcfb7d5199 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Wed, 30 Oct 2024 09:10:10 +0100 Subject: [PATCH] eth_hash: condition converter deprecation warning on nim version (#756) The warning gives too many false positives - until things work properly, locally one can just remove it to find instances where it gets used.. https://github.com/nim-lang/Nim/issues/24241 --- eth/common/eth_hash.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eth/common/eth_hash.nim b/eth/common/eth_hash.nim index a94bcb3..a9583bd 100644 --- a/eth/common/eth_hash.nim +++ b/eth/common/eth_hash.nim @@ -30,5 +30,11 @@ template keccakHash*(v: Address): Hash32 {.deprecated.} = from nimcrypto/hash import MDigest -converter toMDigest*(v: Hash32): MDigest[256] {.deprecated.} = +# TODO https://github.com/nim-lang/Nim/issues/24241 +when (NimMajor, NimMinor) >= (2, 12) or defined(ethDigestConverterWarning): + {.pragma: convdeprecated, deprecated.} +else: + {.pragma: convdeprecated.} + +converter toMDigest*(v: Hash32): MDigest[256] {.convdeprecated.} = MDigest[256](data: v.data)