eth/tracers/logger: using maps.Equal (#29384)

Co-authored-by: Felix Lange <fjl@twurst.com>
pull/29387/head
cui 8 months ago committed by GitHub
parent 7481398a24
commit 0183c7ad82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      eth/tracers/logger/access_list_tracer.go

@ -17,6 +17,8 @@
package logger package logger
import ( import (
"maps"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
@ -71,17 +73,9 @@ func (al accessList) equal(other accessList) bool {
// Accounts match, cross reference the storage slots too // Accounts match, cross reference the storage slots too
for addr, slots := range al { for addr, slots := range al {
otherslots := other[addr] otherslots := other[addr]
if !maps.Equal(slots, otherslots) {
if len(slots) != len(otherslots) {
return false return false
} }
// Given that len(slots) == len(otherslots), we only need to check that
// all the items from slots are in otherslots.
for hash := range slots {
if _, ok := otherslots[hash]; !ok {
return false
}
}
} }
return true return true
} }

Loading…
Cancel
Save