mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
Update chain.go
This commit is contained in:
parent
a487d74971
commit
849366bea4
1 changed files with 2 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ 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
|
||||
|
|
@ -165,7 +166,7 @@ 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 := slices.Clone(c.senders)
|
||||
accounts := maps.Keys(c.senders)
|
||||
slices.SortFunc(accounts, commmon.Address.Cmp)
|
||||
addr := accounts[idx]
|
||||
return addr, c.senders[addr].Nonce
|
||||
|
|
|
|||
Loading…
Reference in a new issue