diff --git a/src/transaction_builder.js b/src/transaction_builder.js index e5e4b2c..b33814b 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -297,7 +297,7 @@ function prepareInput (input, kpPubKey, redeemScript, witnessValue, witnessScrip if (!redeemScript.equals(btemplates.witnessScriptHash.output.encode(witnessScriptHash))) throw new Error('Witness script inconsistent with redeem script') expanded = expandOutput(witnessScript, undefined, kpPubKey) - if (!expanded.pubKeys) throw new Error('WitnessScript not supported "' + bscript.toASM(redeemScript) + '"') + if (!expanded.pubKeys) throw new Error(expanded.scriptType + ' not supported as witnessScript (' + bscript.toASM(witnessScript) + ')') prevOutType = btemplates.types.P2SH prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash) @@ -310,7 +310,7 @@ function prepareInput (input, kpPubKey, redeemScript, witnessValue, witnessScrip checkP2SHInput(input, redeemScriptHash) expanded = expandOutput(redeemScript, undefined, kpPubKey) - if (!expanded.pubKeys) throw new Error(expanded.scriptType + ' not supported as redeemScript (' + bscript.toASM(witnessScript) + ')') + if (!expanded.pubKeys) throw new Error(expanded.scriptType + ' not supported as redeemScript (' + bscript.toASM(redeemScript) + ')') prevOutType = btemplates.types.P2SH prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash) diff --git a/test/fixtures/transaction_builder.json b/test/fixtures/transaction_builder.json index 93e135d..1475c97 100644 --- a/test/fixtures/transaction_builder.json +++ b/test/fixtures/transaction_builder.json @@ -1974,7 +1974,7 @@ ] }, { - "exception": "RedeemScript not supported \"OP_RETURN 06deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474\"", + "exception": "nulldata not supported as redeemScript \\(OP_RETURN 06deadbeef03f895a2ad89fb6d696497af486cb7c644a27aa568c7a18dd06113401115185474\\)", "inputs": [ { "txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", @@ -2117,7 +2117,7 @@ ] }, { - "exception": "RedeemScript not supported \"OP_HASH160 7f67f0521934a57d3039f77f9f32cf313f3ac74b OP_EQUAL\"", + "exception": "scripthash not supported as redeemScript \\(OP_HASH160 7f67f0521934a57d3039f77f9f32cf313f3ac74b OP_EQUAL\\)", "inputs": [ { "txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",