remove errant argument to buildInput in __build
This commit is contained in:
parent
1d6b978aff
commit
eae2c57e73
3 changed files with 13 additions and 28 deletions
|
@ -399,7 +399,7 @@ function buildInput (input, allowIncomplete) {
|
||||||
var sig = []
|
var sig = []
|
||||||
var witness = []
|
var witness = []
|
||||||
if (SIGNABLE.indexOf(scriptType) !== -1) {
|
if (SIGNABLE.indexOf(scriptType) !== -1) {
|
||||||
sig = buildStack(scriptType, input.signatures, input.pubKeys, input.script, allowIncomplete)
|
sig = buildStack(scriptType, input.signatures, input.pubKeys, allowIncomplete)
|
||||||
}
|
}
|
||||||
|
|
||||||
var p2sh = false
|
var p2sh = false
|
||||||
|
|
27
test/fixtures/transaction_builder.json
vendored
27
test/fixtures/transaction_builder.json
vendored
|
@ -1702,33 +1702,6 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"description": "Incomplete transaction w/ prevTxScript defined",
|
|
||||||
"exception": "Not enough signatures provided",
|
|
||||||
"incomplete": true,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
||||||
"vout": 0,
|
|
||||||
"signs": [
|
|
||||||
{
|
|
||||||
"keyPair": "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"txId": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
||||||
"vout": 1,
|
|
||||||
"prevTxScript": "OP_DUP OP_HASH160 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5 OP_EQUALVERIFY OP_CHECKSIG"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"script": "OP_DUP OP_HASH160 aa4d7985c57e011a8b3dd8e0e5a73aaef41629c5 OP_EQUALVERIFY OP_CHECKSIG",
|
|
||||||
"value": 1000
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"description": "Duplicate transaction outs",
|
"description": "Duplicate transaction outs",
|
||||||
"exception": "Duplicate TxOut: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff:0",
|
"exception": "Duplicate TxOut: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff:0",
|
||||||
|
|
|
@ -354,6 +354,18 @@ describe('TransactionBuilder', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('for incomplete with 0 signatures', function () {
|
||||||
|
var randomTxData = '0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100aa5d8aa40a90f23ce2c3d11bc845ca4a12acd99cbea37de6b9f6d86edebba8cb022022dedc2aa0a255f74d04c0b76ece2d7c691f9dd11a64a8ac49f62a99c3a05f9d01232103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ac00000000'
|
||||||
|
var randomAddress = '1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'
|
||||||
|
|
||||||
|
var randomTx = Transaction.fromHex(randomTxData)
|
||||||
|
var tx = new TransactionBuilder()
|
||||||
|
tx.addInput(randomTx, 0)
|
||||||
|
tx.addOutput(baddress.toOutputScript(randomAddress), 1000)
|
||||||
|
tx = tx.buildIncomplete()
|
||||||
|
assert(tx)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('multisig', function () {
|
describe('multisig', function () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue