Skip to content

Commit 5fb847c

Browse files
committed
Fix logging
1 parent f0646d2 commit 5fb847c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

execution_chain/core/chain/forked_chain/chain_branch.nim

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,3 @@ iterator everyNthBlock*(base: BlockRef, step: uint64): BlockRef =
7676
7777
for i in countdown(steps.len-1, 0):
7878
yield steps[i]
79-
80-
func `$`*(b: BlockRef): string =
81-
$(b.number)

execution_chain/core/chain/forked_chain/chain_serialize.nim

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ proc reset(fc: ForkedChainRef, base: BlockRef) =
185185
fc.fcuHead.reset()
186186
fc.fcuSafe.reset()
187187
188+
func toString(list: openArray[BlockRef]): string =
189+
result.add '['
190+
for i, b in list:
191+
result.add $(b.number)
192+
if i < list.len-1:
193+
result.add ','
194+
result.add ']'
195+
188196
# ------------------------------------------------------------------------------
189197
# Public functions
190198
# ------------------------------------------------------------------------------
@@ -210,7 +218,7 @@ proc serialize*(fc: ForkedChainRef, txFrame: CoreDbTxRef): Result[void, CoreDbEr
210218
finalized=fc.latestFinalizedBlockNumber,
211219
finalizedHash=fc.pendingFCU.short,
212220
blocksInMemory=fc.hashToBlock.len,
213-
heads=fc.heads
221+
heads=fc.heads.toString
214222

215223
ok()
216224

@@ -250,7 +258,7 @@ proc deserialize*(fc: ForkedChainRef): Result[void, string] =
250258
canonicalHead=fc.fcuHead.number,
251259
safe=fc.fcuSafe.number,
252260
numBlocks=state.numBlocks,
253-
heads=fc.heads
261+
heads=fc.heads.toString
254262
255263
if state.numBlocks > 64:
256264
info "Please wait until DAG finish loading..."

0 commit comments

Comments
 (0)