From 35adaa84717d42b7f69217e88b31d00bc703ddfc Mon Sep 17 00:00:00 2001
From: junderw <junderwood@bitcoinbank.co.jp>
Date: Sat, 29 Dec 2018 23:27:57 +0900
Subject: [PATCH] Add test from bugfix, also remove unnecessary arg

---
 src/transaction_builder.ts |  4 ++--
 test/fixtures/p2ms.json    | 14 ++++++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/transaction_builder.ts b/src/transaction_builder.ts
index b3c6ee0..59fc102 100644
--- a/src/transaction_builder.ts
+++ b/src/transaction_builder.ts
@@ -279,7 +279,7 @@ export class TransactionBuilder {
       }
 
       if (!canSign(input)) {
-        const prepared = prepareInput(input, ourPubKey, redeemScript, witnessValue, witnessScript)
+        const prepared = prepareInput(input, ourPubKey, redeemScript, witnessScript)
 
         // updates inline
         Object.assign(input, prepared)
@@ -589,7 +589,7 @@ function expandOutput (script: Buffer, ourPubKey?: Buffer): TxbOutput {
   return { type }
 }
 
-function prepareInput (input: TxbInput, ourPubKey: Buffer, redeemScript: Buffer, witnessValue: number, witnessScript: Buffer): TxbInput {
+function prepareInput (input: TxbInput, ourPubKey: Buffer, redeemScript: Buffer, witnessScript: Buffer): TxbInput {
   if (redeemScript && witnessScript) {
     const p2wsh = <Payment> payments.p2wsh({ redeem: { output: witnessScript } })
     const p2wshAlt = <Payment> payments.p2wsh({ output: redeemScript })
diff --git a/test/fixtures/p2ms.json b/test/fixtures/p2ms.json
index 8ea033e..2f41270 100644
--- a/test/fixtures/p2ms.json
+++ b/test/fixtures/p2ms.json
@@ -310,6 +310,20 @@
         ]
       }
     },
+    {
+      "exception": "Signature mismatch",
+      "arguments": {
+        "m": 1,
+        "pubkeys": [
+          "030000000000000000000000000000000000000000000000000000000000000001",
+          "030000000000000000000000000000000000000000000000000000000000000001"
+        ],
+        "signatures": [
+          "300602010002010001"
+        ],
+        "input": "OP_0 300602010002010101"
+      }
+    },
     {
       "exception": "Too many signatures provided",
       "arguments": {