mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 03:38:35 +00:00
services: optimize notary transaction verification
This commit is contained in:
parent
a6d4a266b9
commit
5569f7ad6c
2 changed files with 0 additions and 9 deletions
|
@ -339,9 +339,6 @@ func (n *Notary) verifyIncompleteWitnesses(tx *transaction.Transaction, nKeys ui
|
||||||
if len(tx.Signers) < 2 {
|
if len(tx.Signers) < 2 {
|
||||||
return Unknown, 0, nil, errors.New("transaction should have at least 2 signers")
|
return Unknown, 0, nil, errors.New("transaction should have at least 2 signers")
|
||||||
}
|
}
|
||||||
if len(tx.Signers) != len(tx.Scripts) {
|
|
||||||
return Unknown, 0, nil, fmt.Errorf("transaction should have %d witnesses attached (completed + dummy)", len(tx.Signers))
|
|
||||||
}
|
|
||||||
if !tx.HasSigner(n.Config.Chain.GetNotaryContractScriptHash()) {
|
if !tx.HasSigner(n.Config.Chain.GetNotaryContractScriptHash()) {
|
||||||
return Unknown, 0, nil, fmt.Errorf("P2PNotary contract should be a signer of the transaction")
|
return Unknown, 0, nil, fmt.Errorf("P2PNotary contract should be a signer of the transaction")
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,12 +94,6 @@ func TestVerifyIncompleteRequest(t *testing.T) {
|
||||||
Scripts: []transaction.Witness{{}},
|
Scripts: []transaction.Witness{{}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"signers count and witnesses count mismatch": {
|
|
||||||
tx: &transaction.Transaction{
|
|
||||||
Signers: []transaction.Signer{{Account: notaryContractHash}, {}},
|
|
||||||
Scripts: []transaction.Witness{{}, {}, {}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"missing Notary witness": {
|
"missing Notary witness": {
|
||||||
tx: &transaction.Transaction{
|
tx: &transaction.Transaction{
|
||||||
Signers: []transaction.Signer{{Account: acc1.GetScriptHash()}, {Account: acc2.GetScriptHash()}},
|
Signers: []transaction.Signer{{Account: acc1.GetScriptHash()}, {Account: acc2.GetScriptHash()}},
|
||||||
|
|
Loading…
Reference in a new issue