Update wallet.go

This commit is contained in:
Alvarez 2025-11-26 16:04:35 +01:00
parent ad3a93f8e2
commit a8d26b2e92

View file

@ -340,12 +340,13 @@ func (w *wallet) selfDerive() {
var ( var (
accs []accounts.Account accs []accounts.Account
paths []accounts.DerivationPath paths []accounts.DerivationPath
nextPaths = append([]accounts.DerivationPath{}, w.deriveNextPaths...)
nextAddrs = append([]common.Address{}, w.deriveNextAddrs...)
context = context.Background() context = context.Background()
nextAddrs = append([]common.Address{}, w.deriveNextAddrs...)
) )
nextPaths := make([]accounts.DerivationPath, len(w.deriveNextPaths))
for i, path := range w.deriveNextPaths {
nextPaths[i] = append(accounts.DerivationPath(nil), path...)
}
for i := 0; i < len(nextAddrs); i++ { for i := 0; i < len(nextAddrs); i++ {
for empty := false; !empty; { for empty := false; !empty; {
// Retrieve the next derived Ethereum account // Retrieve the next derived Ethereum account
@ -632,7 +633,7 @@ func (w *wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID
// data is not supported for Ledger wallets, so this method will always return // data is not supported for Ledger wallets, so this method will always return
// an error. // an error.
func (w *wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) { func (w *wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) {
return w.SignText(account, text) return w.SignText(account, accounts.TextHash(text))
} }
// SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given // SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given