From 1b4dc48d75c65c854c23fa7abff7976b7814615a Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Wed, 26 Sep 2018 16:02:13 +1000 Subject: [PATCH] add failing tests for redeem.network derivation --- test/fixtures/p2sh.json | 18 ++++++++++++++++++ test/fixtures/p2wsh.json | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/test/fixtures/p2sh.json b/test/fixtures/p2sh.json index e447e4a..595b85e 100644 --- a/test/fixtures/p2sh.json +++ b/test/fixtures/p2sh.json @@ -166,6 +166,24 @@ ] } } + }, + { + "description": "p2sh-p2pkh, out (network derived from redeem)", + "arguments": { + "redeem": { + "address": "this is P2PKH context, unknown and ignored by P2SH", + "output": "OP_DUP OP_HASH160 c30afa58ae0673b00a45b5c17dff4633780f1400 OP_EQUALVERIFY OP_CHECKSIG", + "network": "testnet" + } + }, + "expected": { + "address": "2N7nfc7zeWuADtpdR4MrR7Wq3dzr7LxTCgS", + "hash": "9f840a5fc02407ef0ad499c2ec0eb0b942fb0086", + "output": "OP_HASH160 9f840a5fc02407ef0ad499c2ec0eb0b942fb0086 OP_EQUAL", + "input": null, + "witness": null, + "network": "testnet" + } } ], "invalid": [ diff --git a/test/fixtures/p2wsh.json b/test/fixtures/p2wsh.json index 2dfec75..e5ce0e0 100644 --- a/test/fixtures/p2wsh.json +++ b/test/fixtures/p2wsh.json @@ -179,6 +179,24 @@ ] } } + }, + { + "description": "p2wsh-p2pkh, out (network derived from redeem)", + "arguments": { + "redeem": { + "address": "this is P2PKH context, unknown and ignored by p2wsh", + "output": "OP_DUP OP_HASH160 c30afa58ae0673b00a45b5c17dff4633780f1400 OP_EQUALVERIFY OP_CHECKSIG", + "network": "testnet" + } + }, + "expected": { + "address": "tb1qusxlgq9quu27ucxs7a2fg8nv0pycdzvxsjk9npyupupxw3y892ssaskm8v", + "hash": "e40df400a0e715ee60d0f754941e6c784986898684ac59849c0f026744872aa1", + "output": "OP_0 e40df400a0e715ee60d0f754941e6c784986898684ac59849c0f026744872aa1", + "input": null, + "witness": null, + "network": "testnet" + } } ], "invalid": [