LiskArchive / lisk-elements

⚙️ Library for sending Lisk transactions from the client or server
https://lisk.io/
GNU General Public License v3.0
250 stars 64 forks source link

Create addMultisignature function in BaseTransaction - Closes #1176 #1183

Closed pablitovicente closed 5 years ago

pablitovicente commented 5 years ago

What was the problem?

There was no method for adding signatures to pending transactions.

How did I fix it?

By adding the method addMultisignatures to BaseTransaction and MultisignatureTransaction

How to test it?

Review checklist

pablitovicente commented 5 years ago

@shuse2 as this method only adds one signature to the transaction trying to use validateMultisignatures() causes issues as that method use case is to check a complete set of signatures for a multi-signature transaction instead of signatures arriving one at a time to a pending transaction that was sent without any signatures or only some of the signatures. Please review the last changes

pablitovicente commented 5 years ago

After our talk I will refactor part of validateMultisignatures() into new methods for sharing the validations

pablitovicente commented 5 years ago

After moving some of the validations in validateMultisignatures() to its own functions still decided to keep the code as we're dealing here with validating a single incoming signature. calling validateMultisignatures() should happen after all signatures are available as a final complete validation. @SargeKhan could you please review?