Explorar el Código

accounts/scwallet: fix crypto API change

Péter Szilágyi hace 7 años
padre
commit
a900e80a89
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      accounts/scwallet/wallet.go

+ 5 - 1
accounts/scwallet/wallet.go

@@ -907,7 +907,11 @@ func (s *Session) derive(path accounts.DerivationPath) (accounts.Account, error)
 			return accounts.Account{}, err
 		}
 	}
-	return s.Wallet.makeAccount(crypto.PubkeyToAddress(*crypto.ToECDSAPub(pubkey)), path), nil
+	pub, err := crypto.UnmarshalPubkey(pubkey)
+	if err != nil {
+		return accounts.Account{}, err
+	}
+	return s.Wallet.makeAccount(crypto.PubkeyToAddress(*pub), path), nil
 }
 
 // keyDerivationInfo contains information on the current key derivation step.