mirror of https://github.com/status-im/nim-eth.git
Propagating the del-returns-a-bool change through the trie DB code. (#578)
See here:
8f0ae55353
This commit is contained in:
parent
68f4c53828
commit
71b148a5b0
|
@ -21,7 +21,7 @@ type
|
||||||
gcsafe, raises: [Defect].}
|
gcsafe, raises: [Defect].}
|
||||||
## The result will be empty seq if not found
|
## 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].}
|
gcsafe, raises: [Defect].}
|
||||||
|
|
||||||
ContainsProc = proc (db: RootRef, key: openArray[byte]): bool {.
|
ContainsProc = proc (db: RootRef, key: openArray[byte]): bool {.
|
||||||
|
@ -172,7 +172,7 @@ proc getImpl[T](db: RootRef, key: openArray[byte]): seq[byte] =
|
||||||
mixin get
|
mixin get
|
||||||
return get(T(db), key)
|
return get(T(db), key)
|
||||||
|
|
||||||
proc delImpl[T](db: RootRef, key: openArray[byte]) =
|
proc delImpl[T](db: RootRef, key: openArray[byte]): bool =
|
||||||
mixin del
|
mixin del
|
||||||
del(T(db), key)
|
del(T(db), key)
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ proc del*(db: TrieDatabaseRef, key: openArray[byte]) =
|
||||||
if t != nil:
|
if t != nil:
|
||||||
t.modifications.del(key)
|
t.modifications.del(key)
|
||||||
else:
|
else:
|
||||||
db.delProc(db.obj, key)
|
discard db.delProc(db.obj, key)
|
||||||
|
|
||||||
proc contains*(db: TrieDatabaseRef, key: openArray[byte]): bool =
|
proc contains*(db: TrieDatabaseRef, key: openArray[byte]): bool =
|
||||||
# TODO: This is quite inefficient and it won't be necessary once
|
# TODO: This is quite inefficient and it won't be necessary once
|
||||||
|
|
Loading…
Reference in New Issue