wallet: provide (*Account).SignHashable API

Make PrivateKey() less used and less useful.
This commit is contained in:
Roman Khimov 2022-09-01 20:42:42 +03:00
parent e569edc841
commit e164625a7f
10 changed files with 24 additions and 16 deletions

View file

@ -58,8 +58,7 @@ func signStoredTransaction(ctx *cli.Context) error {
}
if acc.CanSign() {
priv := acc.PrivateKey()
sign := priv.SignHashable(uint32(pc.Network), pc.Verifiable)
sign := acc.SignHashable(pc.Network, pc.Verifiable)
if err := pc.AddSignature(ch, acc.Contract, acc.PublicKey(), sign); err != nil {
return cli.NewExitError(fmt.Errorf("can't add signature: %w", err), 1)
}