cmd/devp2p/ethtest: fix swapped args in private-key error message

The error "unable to read private key for %s: %v" passed (err, addr),
so it printed the decode error where the account address belongs and the
address where the error belongs. Swap to (addr, err) so the message names
the account that failed and then the reason.
This commit is contained in:
ozpool 2026-06-19 12:41:51 +05:30
parent 7c9032dff6
commit abfa0e60c4
No known key found for this signature in database

View file

@ -335,7 +335,7 @@ func readAccounts(file string) (map[common.Address]*senderInfo, error) {
for addr, acc := range keys { for addr, acc := range keys {
pk, err := crypto.HexToECDSA(common.Bytes2Hex(acc.Key)) pk, err := crypto.HexToECDSA(common.Bytes2Hex(acc.Key))
if err != nil { if err != nil {
return nil, fmt.Errorf("unable to read private key for %s: %v", err, addr) return nil, fmt.Errorf("unable to read private key for %s: %v", addr, err)
} }
accounts[addr] = &senderInfo{Key: pk, Nonce: 0} accounts[addr] = &senderInfo{Key: pk, Nonce: 0}
} }