From d07540766f064c0f4e82665fb33cddaa83165f02 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Fri, 12 Jul 2024 13:40:13 +0200 Subject: [PATCH] coredb: tracking fixes (#2476) --- nimbus/db/core_db/base.nim | 8 ++++---- nimbus/db/core_db/base/api_tracking.nim | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/nimbus/db/core_db/base.nim b/nimbus/db/core_db/base.nim index c4c0c6192..50535beea 100644 --- a/nimbus/db/core_db/base.nim +++ b/nimbus/db/core_db/base.nim @@ -670,7 +670,7 @@ proc slotFetch*( err(rc.error.toError $api) acc.ifTrackNewApi: debug newApiTxt, api, elapsed, accPath=accPath.toStr, - slot=slot.toStr, result + stoPath=stoPath.toStr, result proc slotDelete*( acc: CoreDbAccRef; @@ -691,7 +691,7 @@ proc slotDelete*( err(rc.error.toError $api) acc.ifTrackNewApi: debug newApiTxt, api, elapsed, accPath=accPath.toStr, - slot=slot.toStr, result + stoPath=stoPath.toStr, result proc slotHasPath*( acc: CoreDbAccRef; @@ -708,7 +708,7 @@ proc slotHasPath*( err(rc.error.toError $api) acc.ifTrackNewApi: debug newApiTxt, api, elapsed, accPath=accPath.toStr, - slot=slot.toStr, result + stoPath=stoPath.toStr, result proc slotMerge*( acc: CoreDbAccRef; @@ -726,7 +726,7 @@ proc slotMerge*( err(rc.error.toError $api) acc.ifTrackNewApi: debug newApiTxt, api, elapsed, accPath=accPath.toStr, - slot=slot.toStr, result + stoPath=stoPath.toStr, result proc slotState*( acc: CoreDbAccRef; diff --git a/nimbus/db/core_db/base/api_tracking.nim b/nimbus/db/core_db/base/api_tracking.nim index 280342eb2..af443a222 100644 --- a/nimbus/db/core_db/base/api_tracking.nim +++ b/nimbus/db/core_db/base/api_tracking.nim @@ -123,7 +123,7 @@ func toStr*(w: openArray[byte]): string = func toStr*(w: set[CoreDbCaptFlags]): string = "Flags[" & $w.len & "]" -proc toStr*(rc: CoreDbRc[int]): string = +proc toStr*(rc: CoreDbRc[int]|CoreDbRc[UInt256]): string = if rc.isOk: "ok(" & $rc.value & ")" else: "err(" & rc.error.toStr & ")" proc toStr*(rc: CoreDbRc[bool]): string = @@ -136,10 +136,7 @@ proc toStr*(rc: CoreDbRc[Blob]): string = if rc.isOk: "ok(Blob[" & $rc.value.len & "])" else: "err(" & rc.error.toStr & ")" -proc toStr*(rc: CoreDbRc[Hash256]): string = - if rc.isOk: "ok(" & rc.value.toStr & ")" else: "err(" & rc.error.toStr & ")" - -proc toStr*(rc: CoreDbRc[set[CoreDbCaptFlags]]): string = +proc toStr*[T](rc: CoreDbRc[T]): string = if rc.isOk: "ok(" & rc.value.toStr & ")" else: "err(" & rc.error.toStr & ")" proc toStr*(rc: CoreDbRc[Account]): string =