From 4b03f6d4db990dcf27f17244b671826471a4aa84 Mon Sep 17 00:00:00 2001 From: coffeepots Date: Wed, 15 Aug 2018 13:13:30 +0100 Subject: [PATCH] Updated hexstrings to translate common Nimbus types to hex strings --- nimbus/rpc/hexstrings.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nimbus/rpc/hexstrings.nim b/nimbus/rpc/hexstrings.nim index e80da1d78..039e34d56 100644 --- a/nimbus/rpc/hexstrings.nim +++ b/nimbus/rpc/hexstrings.nim @@ -10,7 +10,7 @@ ## This module implements the Ethereum hexadecimal string formats for JSON ## See: https://github.com/ethereum/wiki/wiki/JSON-RPC#hex-value-encoding -import eth_common/eth_types, stint, byteutils +import eth_common/eth_types, stint, byteutils, nimcrypto type HexQuantityStr* = distinct string @@ -142,6 +142,9 @@ proc `%`*(value: EthHashStr): JsonNode = proc `%`*(value: EthAddress): JsonNode = result = %("0x" & value.toHex) +proc `%`*(value: Hash256): JsonNode = + result = %("0x" & $value) + proc `%`*(value: UInt256): JsonNode = result = %("0x" & value.toString)