Browse Source
Fix test cases to make sure that validate: true is being set to default
v4
junderw
6 years ago
No known key found for this signature in database
GPG Key ID: B256185D3A971908
8 changed files with
24 additions and
1 deletions
-
test/fixtures/embed.json
-
test/fixtures/p2ms.json
-
test/fixtures/p2pk.json
-
test/fixtures/p2pkh.json
-
test/fixtures/p2sh.json
-
test/fixtures/p2wpkh.json
-
test/fixtures/p2wsh.json
-
test/transaction_builder.js
|
|
@ -5,6 +5,7 @@ |
|
|
|
"arguments": { |
|
|
|
"output": "OP_RETURN a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4" |
|
|
|
}, |
|
|
|
"options": {}, |
|
|
|
"expected": { |
|
|
|
"data": [ |
|
|
|
"a3b147dbe4a85579fc4b5a1811e76620560e07267e62b9a0d6858f9127735cadd82f67e06c24dbc4" |
|
|
@ -35,6 +36,14 @@ |
|
|
|
{ |
|
|
|
"exception": "Not enough data", |
|
|
|
"arguments": {} |
|
|
|
}, |
|
|
|
{ |
|
|
|
"description": "First OP is not OP_RETURN", |
|
|
|
"exception": "Output is invalid", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"output": "OP_1 OP_2 OP_ADD" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
"dynamic": { |
|
|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
"arguments": { |
|
|
|
"output": "OP_2 030000000000000000000000000000000000000000000000000000000000000001 030000000000000000000000000000000000000000000000000000000000000002 OP_2 OP_CHECKMULTISIG" |
|
|
|
}, |
|
|
|
"options": {}, |
|
|
|
"expected": { |
|
|
|
"m": 2, |
|
|
|
"n": 2, |
|
|
@ -239,6 +240,7 @@ |
|
|
|
{ |
|
|
|
"description": "n !== output pubkeys", |
|
|
|
"exception": "Output is invalid", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"output": "OP_1 030000000000000000000000000000000000000000000000000000000000000001 OP_2 OP_CHECKMULTISIG" |
|
|
|
} |
|
|
@ -266,6 +268,7 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
"exception": "Pubkeys mismatch", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"pubkeys": [ |
|
|
|
"030000000000000000000000000000000000000000000000000000000000000001" |
|
|
@ -325,6 +328,7 @@ |
|
|
|
{ |
|
|
|
"description": "Missing OP_0", |
|
|
|
"exception": "Input is invalid", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"m": 2, |
|
|
|
"pubkeys": [ |
|
|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
"arguments": { |
|
|
|
"output": "030000000000000000000000000000000000000000000000000000000000000001 OP_CHECKSIG" |
|
|
|
}, |
|
|
|
"options": {}, |
|
|
|
"expected": { |
|
|
|
"pubkey": "030000000000000000000000000000000000000000000000000000000000000001", |
|
|
|
"signature": null, |
|
|
@ -97,6 +98,7 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
"exception": "Pubkey mismatch", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"pubkey": "030000000000000000000000000000000000000000000000000000000000000001", |
|
|
|
"output": "030000000000000000000000000000000000000000000000000000000000000002 OP_CHECKSIG" |
|
|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
"arguments": { |
|
|
|
"address": "134D6gYy8DsR5m4416BnmgASuMBqKvogQh" |
|
|
|
}, |
|
|
|
"options": {}, |
|
|
|
"expected": { |
|
|
|
"hash": "168b992bcfc44050310b3a94bd0771136d0b28d1", |
|
|
|
"output": "OP_DUP OP_HASH160 168b992bcfc44050310b3a94bd0771136d0b28d1 OP_EQUALVERIFY OP_CHECKSIG", |
|
|
@ -103,6 +104,7 @@ |
|
|
|
{ |
|
|
|
"description": "Unexpected OP_DUP", |
|
|
|
"exception": "Output is invalid", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"output": "OP_DUP OP_DUP 168b992bcfc44050310b3a94bd0771136d0b28d137 OP_EQUALVERIFY" |
|
|
|
} |
|
|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
"arguments": { |
|
|
|
"address": "3GETYP4cuSesh2zsPEEYVZqnRedwe4FwUT" |
|
|
|
}, |
|
|
|
"options": {}, |
|
|
|
"expected": { |
|
|
|
"hash": "9f840a5fc02407ef0ad499c2ec0eb0b942fb0086", |
|
|
|
"output": "OP_HASH160 9f840a5fc02407ef0ad499c2ec0eb0b942fb0086 OP_EQUAL", |
|
|
@ -182,6 +183,7 @@ |
|
|
|
{ |
|
|
|
"description": "Expected OP_HASH160", |
|
|
|
"exception": "Output is invalid", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"output": "OP_HASH256 ffffffffffffffffffffffffffffffffffffffff OP_EQUAL" |
|
|
|
} |
|
|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
"arguments": { |
|
|
|
"address": "bc1qafk4yhqvj4wep57m62dgrmutldusqde8adh20d" |
|
|
|
}, |
|
|
|
"options": {}, |
|
|
|
"expected": { |
|
|
|
"hash": "ea6d525c0c955d90d3dbd29a81ef8bfb79003727", |
|
|
|
"output": "OP_0 ea6d525c0c955d90d3dbd29a81ef8bfb79003727", |
|
|
@ -108,6 +109,7 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
"exception": "Pubkey mismatch", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"pubkey": "030000000000000000000000000000000000000000000000000000000000000001", |
|
|
|
"witness": [ |
|
|
|
|
|
@ -5,6 +5,7 @@ |
|
|
|
"arguments": { |
|
|
|
"address": "bc1q6rgl33d3s9dugudw7n68yrryajkr3ha9q8q24j20zs62se4q9tsqdy0t2q" |
|
|
|
}, |
|
|
|
"options": {}, |
|
|
|
"expected": { |
|
|
|
"hash": "d0d1f8c5b1815bc471aef4f4720c64ecac38dfa501c0aac94f1434a866a02ae0", |
|
|
|
"output": "OP_0 d0d1f8c5b1815bc471aef4f4720c64ecac38dfa501c0aac94f1434a866a02ae0", |
|
|
@ -221,6 +222,7 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
"exception": "Output is invalid", |
|
|
|
"options": {}, |
|
|
|
"arguments": { |
|
|
|
"output": "OP_HASH256 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff OP_EQUAL" |
|
|
|
} |
|
|
|
|
|
@ -477,7 +477,7 @@ describe('TransactionBuilder', function () { |
|
|
|
redeem: payments.p2ms({ |
|
|
|
output: redeemScript, |
|
|
|
signatures |
|
|
|
}, { allowIncomplete: true }) |
|
|
|
}, { allowIncomplete: true, validate: false }) |
|
|
|
}).input |
|
|
|
assert.strictEqual(bscript.toASM(replacement), sign.scriptSigFiltered) |
|
|
|
|
|
|
|