From 9a31b894c11f977dd9aa7c8f5e73ab019290a558 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Wed, 17 Jan 2018 14:40:21 +1100 Subject: [PATCH] tests: add inconsistent redeem/witness script hash signing tests --- test/fixtures/transaction_builder.json | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/test/fixtures/transaction_builder.json b/test/fixtures/transaction_builder.json index 5d746a1..b9d2969 100644 --- a/test/fixtures/transaction_builder.json +++ b/test/fixtures/transaction_builder.json @@ -2015,6 +2015,56 @@ } ] }, + { + "description": "Inconsistent RedeemScript hash", + "exception": "Inconsistent hash160", + "inputs": [ + { + "txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "vout": 0, + "prevTxScript": "OP_HASH160 ffffffffffffffffffffffffffffffffffffffff OP_EQUAL", + "signs": [ + { + "keyPair": "5JiHJJjdufSiMxbvnyNcKtQNLYH6SvUpQnRv9yZENFDWTQKQkzC", + "redeemScript": "OP_1", + "value": 10000, + "throws": true + } + ] + } + ], + "outputs": [ + { + "script": "OP_0 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5", + "value": 10000 + } + ] + }, + { + "description": "Inconsistent WitnessScript hash", + "exception": "Inconsistent sha256", + "inputs": [ + { + "txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "vout": 0, + "prevTxScript": "OP_0 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "signs": [ + { + "keyPair": "5JiHJJjdufSiMxbvnyNcKtQNLYH6SvUpQnRv9yZENFDWTQKQkzC", + "witnessScript": "OP_1", + "value": 10000, + "throws": true + } + ] + } + ], + "outputs": [ + { + "script": "OP_0 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5", + "value": 10000 + } + ] + }, { "exception": "RedeemScript not supported \"OP_HASH160 7f67f0521934a57d3039f77f9f32cf313f3ac74b OP_EQUAL\"", "inputs": [