services: optimize notary transaction verification

This commit is contained in:
Anna Shaleva 2021-02-16 20:03:19 +03:00
parent a6d4a266b9
commit 5569f7ad6c
2 changed files with 0 additions and 9 deletions

View file

@ -339,9 +339,6 @@ func (n *Notary) verifyIncompleteWitnesses(tx *transaction.Transaction, nKeys ui
if len(tx.Signers) < 2 {
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()) {
return Unknown, 0, nil, fmt.Errorf("P2PNotary contract should be a signer of the transaction")
}

View file

@ -94,12 +94,6 @@ func TestVerifyIncompleteRequest(t *testing.T) {
Scripts: []transaction.Witness{{}},
},
},
"signers count and witnesses count mismatch": {
tx: &transaction.Transaction{
Signers: []transaction.Signer{{Account: notaryContractHash}, {}},
Scripts: []transaction.Witness{{}, {}, {}},
},
},
"missing Notary witness": {
tx: &transaction.Transaction{
Signers: []transaction.Signer{{Account: acc1.GetScriptHash()}, {Account: acc2.GetScriptHash()}},