Skip to content

Commit

Permalink
fix original value retrieval
Browse files Browse the repository at this point in the history
Signed-off-by: Danno Ferrin <[email protected]>
  • Loading branch information
shemnon committed Oct 14, 2023
1 parent 830ab3d commit a3ba879
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,10 @@ public UInt256 getStorageValue(final UInt256 key) {

@Override
public UInt256 getOriginalStorageValue(final UInt256 key) {
if (storageWasCleared) {
return getStorageValue(key);
} else {
return account.getOriginalStorageValue(key);
}
// if storage was cleared then it is because it was an empty account, hence zero storage
// if we have no backing account, it's a new account, hence zero storage
// otherwise ask outside of what we are journaling, journaled change may not be original value
return (storageWasCleared || account == null) ? UInt256.ZERO : account.getStorageValue(key);
}

@Override
Expand Down

0 comments on commit a3ba879

Please sign in to comment.