From b09a3a6b4aba37a5f56fd47f2974141d5f98e93c Mon Sep 17 00:00:00 2001 From: cheatfate Date: Thu, 10 Jun 2021 20:51:15 +0300 Subject: [PATCH] Fix `aggregation_bits` json serialization. --- beacon_chain/rpc/eth2_json_rest_serialization.nim | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/beacon_chain/rpc/eth2_json_rest_serialization.nim b/beacon_chain/rpc/eth2_json_rest_serialization.nim index 3fd6886b0..95a518589 100644 --- a/beacon_chain/rpc/eth2_json_rest_serialization.nim +++ b/beacon_chain/rpc/eth2_json_rest_serialization.nim @@ -77,17 +77,6 @@ proc jsonErrorList*(t: typedesc[RestApiResponse], stream.getOutput(string) RestApiResponse.error(status, data, "application/json") -template hexCompressed(data: openarray[byte]): string = - let offset = - block: - var res = 0 - for i in 0 ..< len(data): - if data[i] != 0x00'u8: - res = i - break - res - "0x" & ncrutils.toHex(data.toOpenArray(offset, len(data) - 1), true) - template hexOriginal(data: openarray[byte]): string = "0x" & ncrutils.toHex(data, true) @@ -234,7 +223,7 @@ proc readValue*(reader: var JsonReader[RestJson], value: var BitSeq) {. proc writeValue*(writer: var JsonWriter[RestJson], value: BitSeq) {. raises: [IOError, Defect].} = - writeValue(writer, hexCompressed(value.bytes())) + writeValue(writer, hexOriginal(value.bytes())) ## BitList proc readValue*(reader: var JsonReader[RestJson], value: var BitList) =