From 8a37c1193a7aeb8c4341e6cf4bf1f6b90e8a56c4 Mon Sep 17 00:00:00 2001
From: Daniel Cousens <github@dcousens.com>
Date: Thu, 28 Jan 2016 00:48:44 +1100
Subject: [PATCH] tests: add signature invalidation test for setLockTime

---
 test/transaction_builder.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/transaction_builder.js b/test/transaction_builder.js
index b6d2896..afbb6d9 100644
--- a/test/transaction_builder.js
+++ b/test/transaction_builder.js
@@ -241,6 +241,17 @@ describe('TransactionBuilder', function () {
     })
   })
 
+  describe('setLockTime', function () {
+    it('throws if if there exist any scriptSigs', function () {
+      txb.addInput(txHash, 0)
+      txb.sign(0, keyPair)
+
+      assert.throws(function () {
+        txb.setLockTime(65535)
+      }, /No, this would invalidate signatures/)
+    })
+  })
+
   describe('sign', function () {
     fixtures.invalid.sign.forEach(function (f) {
       it('throws on ' + f.exception + (f.description ? ' (' + f.description + ')' : ''), function () {