From 71b148a5b0190d7605eb1eba062f1632060cb74e Mon Sep 17 00:00:00 2001 From: Adam Spitz Date: Tue, 17 Jan 2023 16:39:28 -0500 Subject: [PATCH] Propagating the del-returns-a-bool change through the trie DB code. (#578) See here: https://github.com/status-im/nim-eth/commit/8f0ae55353b95f888dce8a32bf810e58f7091b96 --- eth/trie/db.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/trie/db.nim b/eth/trie/db.nim index 3bf489d..d7f79a5 100644 --- a/eth/trie/db.nim +++ b/eth/trie/db.nim @@ -21,7 +21,7 @@ type gcsafe, raises: [Defect].} ## The result will be empty seq if not found - DelProc = proc (db: RootRef, key: openArray[byte]) {. + DelProc = proc (db: RootRef, key: openArray[byte]): bool {. gcsafe, raises: [Defect].} ContainsProc = proc (db: RootRef, key: openArray[byte]): bool {. @@ -172,7 +172,7 @@ proc getImpl[T](db: RootRef, key: openArray[byte]): seq[byte] = mixin get return get(T(db), key) -proc delImpl[T](db: RootRef, key: openArray[byte]) = +proc delImpl[T](db: RootRef, key: openArray[byte]): bool = mixin del del(T(db), key) @@ -217,7 +217,7 @@ proc del*(db: TrieDatabaseRef, key: openArray[byte]) = if t != nil: t.modifications.del(key) else: - db.delProc(db.obj, key) + discard db.delProc(db.obj, key) proc contains*(db: TrieDatabaseRef, key: openArray[byte]): bool = # TODO: This is quite inefficient and it won't be necessary once