fix: serializing an unsigned tx should throw

This commit is contained in:
Trent Nelson
2020-07-07 16:56:50 -06:00
committed by Trent Nelson
parent 57576b07ef
commit 3e3241125f
2 changed files with 25 additions and 225 deletions

View File

@@ -400,7 +400,7 @@ export class Transaction {
*/
serialize(): Buffer {
const {signatures} = this;
if (!signatures) {
if (!signatures || signatures.length === 0 || !this.verifySignatures()) {
throw new Error('Transaction has not been signed');
}