mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
wallet: provide (*Account).SignHashable API
Make PrivateKey() less used and less useful.
This commit is contained in:
parent
e569edc841
commit
e164625a7f
10 changed files with 24 additions and 16 deletions
|
@ -74,7 +74,7 @@ func (s *signer) ScriptHash() util.Uint160 {
|
|||
// SignHashable implements Signer interface.
|
||||
func (s *signer) SignHashable(magic uint32, item hash.Hashable) []byte {
|
||||
return append([]byte{byte(opcode.PUSHDATA1), 64},
|
||||
(*wallet.Account)(s).PrivateKey().SignHashable(magic, item)...)
|
||||
(*wallet.Account)(s).SignHashable(netmode.Magic(magic), item)...)
|
||||
}
|
||||
|
||||
// SignTx implements Signer interface.
|
||||
|
@ -130,7 +130,7 @@ func (m multiSigner) Script() []byte {
|
|||
func (m multiSigner) SignHashable(magic uint32, item hash.Hashable) []byte {
|
||||
var script []byte
|
||||
for i := 0; i < m.m; i++ {
|
||||
sign := m.accounts[i].PrivateKey().SignHashable(magic, item)
|
||||
sign := m.accounts[i].SignHashable(netmode.Magic(magic), item)
|
||||
script = append(script, byte(opcode.PUSHDATA1), 64)
|
||||
script = append(script, sign...)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue