wallet: export GetVerificationScript method

We need it to construct witness for P2PNotaryRequest.
This commit is contained in:
Anna Shaleva 2021-02-08 13:47:52 +03:00
parent afdfa9ce62
commit 59ad0e5e04

View file

@ -108,7 +108,7 @@ func (a *Account) SignTx(t *transaction.Transaction) error {
} }
sign := a.privateKey.Sign(data) sign := a.privateKey.Sign(data)
verif := a.getVerificationScript() verif := a.GetVerificationScript()
invoc := append([]byte{byte(opcode.PUSHDATA1), 64}, sign...) invoc := append([]byte{byte(opcode.PUSHDATA1), 64}, sign...)
for i := range t.Scripts { for i := range t.Scripts {
if bytes.Equal(t.Scripts[i].VerificationScript, verif) { if bytes.Equal(t.Scripts[i].VerificationScript, verif) {
@ -124,7 +124,8 @@ func (a *Account) SignTx(t *transaction.Transaction) error {
return nil return nil
} }
func (a *Account) getVerificationScript() []byte { // GetVerificationScript returns account's verification script.
func (a *Account) GetVerificationScript() []byte {
if a.Contract != nil { if a.Contract != nil {
return a.Contract.Script return a.Contract.Script
} }