eth/gasestimator, internal/ethapi: move gas estimator out of rpc (#28600)

This commit is contained in:
Péter Szilágyi
2023-11-27 16:20:09 +02:00
committed by GitHub
parent 333dd956bf
commit 1e28e0bb03
3 changed files with 222 additions and 129 deletions
+4 -4
View File
@@ -910,18 +910,18 @@ func TestCall(t *testing.T) {
}
}
type Account struct {
type account struct {
key *ecdsa.PrivateKey
addr common.Address
}
func newAccounts(n int) (accounts []Account) {
func newAccounts(n int) (accounts []account) {
for i := 0; i < n; i++ {
key, _ := crypto.GenerateKey()
addr := crypto.PubkeyToAddress(key.PublicKey)
accounts = append(accounts, Account{key: key, addr: addr})
accounts = append(accounts, account{key: key, addr: addr})
}
slices.SortFunc(accounts, func(a, b Account) int { return a.addr.Cmp(b.addr) })
slices.SortFunc(accounts, func(a, b account) int { return a.addr.Cmp(b.addr) })
return accounts
}