fix some failing tests

This commit is contained in:
Jared Wasinger 2025-10-04 14:30:20 +08:00
parent 1ac95d5752
commit ebcabb7b3e

View file

@ -199,6 +199,9 @@ func (a *AccessListBuilder) FinaliseIdxChanges() (*StateDiff, StateAccesses) {
access.storageReads[key] = struct{}{} access.storageReads[key] = struct{}{}
} }
} }
if len(access.storageMutations) == 0 {
access.storageMutations = nil
}
} }
// two scenarios where an account can become non-existent: // two scenarios where an account can become non-existent:
@ -219,6 +222,13 @@ func (a *AccessListBuilder) FinaliseIdxChanges() (*StateDiff, StateAccesses) {
stateAccesses[addr] = access.storageReads stateAccesses[addr] = access.storageReads
} }
continue continue
} else if !createdInTx && access.code == nil && access.nonce == nil && access.balance == nil && len(access.storageMutations) == 0 {
// TODO: refactor this path
// path description: if the net mutations of an account are zero, it ends up as a read.
// TODO: if I remove this branch, why doesn't the affected tests silently pass?
stateAccesses[addr] = access.storageReads
continue
} }
stateAccesses[addr] = access.storageReads stateAccesses[addr] = access.storageReads