Fluffy State Bridge: State building fixes (#2589)
* Fix bug where code was not correctly being updated during contract creation. * Delete value from update cache during db delete.
This commit is contained in:
parent
35cc78c86d
commit
139b35a80a
|
@ -122,6 +122,9 @@ proc del(
|
|||
): bool {.gcsafe, raises: [].} =
|
||||
if dbBackend.contains(key):
|
||||
doAssert dbBackend.tx.delete(key, dbBackend.cfHandle).isOk()
|
||||
|
||||
if not dbBackend.updatedCache.isNil():
|
||||
dbBackend.updatedCache.del(key)
|
||||
true
|
||||
else:
|
||||
false
|
||||
|
|
|
@ -52,15 +52,9 @@ proc applyStateDiff*(worldState: WorldStateRef, txDiff: TransactionDiff) =
|
|||
|
||||
if nonceDiff.kind == create or nonceDiff.kind == update:
|
||||
accState.setNonce(nonceDiff.after)
|
||||
elif nonceDiff.kind == delete:
|
||||
doAssert deleteAccount == true
|
||||
|
||||
if codeDiff.kind == create and codeDiff.after.len() > 0:
|
||||
if codeDiff.kind == create or codeDiff.kind == update:
|
||||
accState.setCode(codeDiff.after)
|
||||
elif codeDiff.kind == update:
|
||||
accState.setCode(codeDiff.after)
|
||||
elif codeDiff.kind == delete:
|
||||
doAssert deleteAccount == true
|
||||
|
||||
for (slotKey, slotValueDiff) in storageDiff:
|
||||
if slotValueDiff.kind == create or slotValueDiff.kind == update:
|
||||
|
|
Loading…
Reference in New Issue