mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 11:36:37 +00:00
core/state: remove pointless wrapper functions (#30891)
This commit is contained in:
parent
330190e476
commit
c7e740f40c
2 changed files with 4 additions and 15 deletions
|
|
@ -139,10 +139,7 @@ func (al *accessList) Equal(other *accessList) bool {
|
||||||
if !maps.Equal(al.addresses, other.addresses) {
|
if !maps.Equal(al.addresses, other.addresses) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return slices.EqualFunc(al.slots, other.slots,
|
return slices.EqualFunc(al.slots, other.slots, maps.Equal)
|
||||||
func(m map[common.Hash]struct{}, m2 map[common.Hash]struct{}) bool {
|
|
||||||
return maps.Equal(m, m2)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrettyPrint prints the contents of the access list in a human-readable form
|
// PrettyPrint prints the contents of the access list in a human-readable form
|
||||||
|
|
|
||||||
|
|
@ -650,11 +650,7 @@ func (test *snapshotTest) checkEqual(state, checkstate *StateDB) error {
|
||||||
{
|
{
|
||||||
have := state.transientStorage
|
have := state.transientStorage
|
||||||
want := checkstate.transientStorage
|
want := checkstate.transientStorage
|
||||||
eq := maps.EqualFunc(have, want,
|
if !maps.EqualFunc(have, want, maps.Equal) {
|
||||||
func(a Storage, b Storage) bool {
|
|
||||||
return maps.Equal(a, b)
|
|
||||||
})
|
|
||||||
if !eq {
|
|
||||||
return fmt.Errorf("transient storage differs ,have\n%v\nwant\n%v",
|
return fmt.Errorf("transient storage differs ,have\n%v\nwant\n%v",
|
||||||
have.PrettyPrint(),
|
have.PrettyPrint(),
|
||||||
want.PrettyPrint())
|
want.PrettyPrint())
|
||||||
|
|
@ -1034,12 +1030,8 @@ func testMissingTrieNodes(t *testing.T, scheme string) {
|
||||||
|
|
||||||
func TestStateDBAccessList(t *testing.T) {
|
func TestStateDBAccessList(t *testing.T) {
|
||||||
// Some helpers
|
// Some helpers
|
||||||
addr := func(a string) common.Address {
|
addr := common.HexToAddress
|
||||||
return common.HexToAddress(a)
|
slot := common.HexToHash
|
||||||
}
|
|
||||||
slot := func(a string) common.Hash {
|
|
||||||
return common.HexToHash(a)
|
|
||||||
}
|
|
||||||
|
|
||||||
db := NewDatabaseForTesting()
|
db := NewDatabaseForTesting()
|
||||||
state, _ := New(types.EmptyRootHash, db)
|
state, _ := New(types.EmptyRootHash, db)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue