all: remove exp dependency
This commit is contained in:
parent
f0fc038125
commit
75be3da679
|
@ -24,6 +24,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"math/big"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -40,7 +41,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/eth/protocols/eth"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
// Chain is a lightweight blockchain-like store which can read a hivechain
|
||||
|
@ -162,8 +162,8 @@ func (c *Chain) RootAt(height int) common.Hash {
|
|||
// GetSender returns the address associated with account at the index in the
|
||||
// pre-funded accounts list.
|
||||
func (c *Chain) GetSender(idx int) (common.Address, uint64) {
|
||||
accounts := maps.Keys(c.senders)
|
||||
slices.SortFunc(accounts, common.Address.Cmp)
|
||||
accounts := slices.SortedFunc(maps.Keys(c.senders), common.Address.Cmp)
|
||||
|
||||
addr := accounts[idx]
|
||||
return addr, c.senders[addr].Nonce
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"os"
|
||||
"regexp"
|
||||
"slices"
|
||||
|
@ -28,7 +29,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
"github.com/ethereum/go-ethereum/tests"
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
var blockTestCommand = &cli.Command{
|
||||
|
@ -80,8 +80,7 @@ func runBlockTest(ctx *cli.Context, fname string) ([]testResult, error) {
|
|||
tracer := tracerFromFlags(ctx)
|
||||
|
||||
// Pull out keys to sort and ensure tests are run in order.
|
||||
keys := maps.Keys(tests)
|
||||
slices.Sort(keys)
|
||||
keys := slices.Sorted(maps.Keys(tests))
|
||||
|
||||
// Run all the tests.
|
||||
var results []testResult
|
||||
|
|
|
@ -19,6 +19,7 @@ package snapshot
|
|||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"maps"
|
||||
"math"
|
||||
"math/rand"
|
||||
"slices"
|
||||
|
@ -30,7 +31,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
bloomfilter "github.com/holiman/bloomfilter/v2"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -431,8 +431,7 @@ func (dl *diffLayer) AccountList() []common.Hash {
|
|||
dl.lock.Lock()
|
||||
defer dl.lock.Unlock()
|
||||
|
||||
dl.accountList = maps.Keys(dl.accountData)
|
||||
slices.SortFunc(dl.accountList, common.Hash.Cmp)
|
||||
dl.accountList = slices.SortedFunc(maps.Keys(dl.accountData), common.Hash.Cmp)
|
||||
dl.memory += uint64(len(dl.accountList) * common.HashLength)
|
||||
return dl.accountList
|
||||
}
|
||||
|
@ -464,8 +463,7 @@ func (dl *diffLayer) StorageList(accountHash common.Hash) []common.Hash {
|
|||
dl.lock.Lock()
|
||||
defer dl.lock.Unlock()
|
||||
|
||||
storageList := maps.Keys(dl.storageData[accountHash])
|
||||
slices.SortFunc(storageList, common.Hash.Cmp)
|
||||
storageList := slices.SortedFunc(maps.Keys(dl.storageData[accountHash]), common.Hash.Cmp)
|
||||
dl.storageList[accountHash] = storageList
|
||||
dl.memory += uint64(len(dl.storageList)*common.HashLength + common.HashLength)
|
||||
return storageList
|
||||
|
|
|
@ -28,7 +28,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"golang.org/x/exp/slices"
|
||||
"slices"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
2
go.mod
2
go.mod
|
@ -64,7 +64,6 @@ require (
|
|||
github.com/urfave/cli/v2 v2.25.7
|
||||
go.uber.org/automaxprocs v1.5.2
|
||||
golang.org/x/crypto v0.32.0
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
|
||||
golang.org/x/sync v0.10.0
|
||||
golang.org/x/sys v0.29.0
|
||||
golang.org/x/text v0.21.0
|
||||
|
@ -143,6 +142,7 @@ require (
|
|||
github.com/tklauser/go-sysconf v0.3.12 // indirect
|
||||
github.com/tklauser/numcpus v0.6.1 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
|
||||
golang.org/x/mod v0.22.0 // indirect
|
||||
golang.org/x/net v0.34.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
|
|
@ -19,6 +19,7 @@ package pathdb
|
|||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"slices"
|
||||
"sync"
|
||||
|
||||
|
@ -27,7 +28,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
// counter helps in tracking items and their corresponding sizes.
|
||||
|
@ -174,8 +174,7 @@ func (s *stateSet) accountList() []common.Hash {
|
|||
s.listLock.Lock()
|
||||
defer s.listLock.Unlock()
|
||||
|
||||
list = maps.Keys(s.accountData)
|
||||
slices.SortFunc(list, common.Hash.Cmp)
|
||||
list = slices.SortedFunc(maps.Keys(s.accountData), common.Hash.Cmp)
|
||||
s.accountListSorted = list
|
||||
return list
|
||||
}
|
||||
|
@ -205,8 +204,7 @@ func (s *stateSet) storageList(accountHash common.Hash) []common.Hash {
|
|||
s.listLock.Lock()
|
||||
defer s.listLock.Unlock()
|
||||
|
||||
list := maps.Keys(s.storageData[accountHash])
|
||||
slices.SortFunc(list, common.Hash.Cmp)
|
||||
list := slices.SortedFunc(maps.Keys(s.storageData[accountHash]), common.Hash.Cmp)
|
||||
s.storageListSorted[accountHash] = list
|
||||
return list
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue