@@ -30,28 +30,28 @@ import (
3030 "fmt"
3131 "math/big"
3232 "os"
33- "sort"
3433 "strconv"
3534
3635 "github.com/ethereum/go-ethereum/core"
3736 "github.com/ethereum/go-ethereum/rlp"
37+ "golang.org/x/exp/slices"
3838)
3939
4040type allocItem struct { Addr , Balance * big.Int }
4141
4242func makelist (g * core.Genesis ) []allocItem {
43- a := make ([]allocItem , 0 , len (g .Alloc ))
43+ items := make ([]allocItem , 0 , len (g .Alloc ))
4444 for addr , account := range g .Alloc {
4545 if len (account .Storage ) > 0 || len (account .Code ) > 0 || account .Nonce != 0 {
4646 panic (fmt .Sprintf ("can't encode account %x" , addr ))
4747 }
4848 bigAddr := new (big.Int ).SetBytes (addr .Bytes ())
49- a = append (a , allocItem {bigAddr , account .Balance })
49+ items = append (items , allocItem {bigAddr , account .Balance })
5050 }
51- slices .SortFunc (a , func (b , c allocItem ) bool {
52- return b .Addr .Cmp (c .Addr ) < 0
51+ slices .SortFunc (items , func (a , b allocItem ) bool {
52+ return a .Addr .Cmp (b .Addr ) < 0
5353 })
54- return a
54+ return items
5555}
5656
5757func makealloc (g * core.Genesis ) string {
0 commit comments