Skip to content

Commit ccec864

Browse files
committed
locktime and version were set too late in test scenario and not included when signing (the test scenario).
1 parent 96fb92f commit ccec864

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

test/fixtures/transaction_builder.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
},
243243
{
244244
"description": "Transaction w/ non-default input sequence numbers, version and locktime",
245-
"txHex": "0400000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff020000006b483045022100c5bcd521df085481e2dcc2c0f14173043f0fa2001dca582b45186a95d248d28002204c571eabcec1410bd53a7da29b9da6b4c858c3fdabbfdb110a030c507ff5bc0501210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b9c220000110270000000000001976a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac09990400",
245+
"txHex": "0400000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff020000006a47304402200e7c0330f39c04e3c1b9e3daf71d106c7129c095f6ebb494d06f0ef8013b74ea022003fc0fe05e71a2a4f8434feb0632cdb6883676d0ccb9b19d7a8a9e5fc02a616401210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798b9c220000110270000000000001976a914aa4d7985c57e011a8b3dd8e0e5a73aaef41629c588ac09990400",
246246
"version": 4,
247247
"locktime": 301321,
248248
"inputs": [

test/transaction_builder.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ function construct (f, sign) {
1717
var network = NETWORKS[f.network]
1818
var txb = new TransactionBuilder(network)
1919

20+
// FIXME: add support for locktime/version in TransactionBuilder API
21+
if (f.version !== undefined) {
22+
txb.tx.version = f.version
23+
}
24+
25+
if (f.locktime !== undefined) {
26+
txb.tx.locktime = f.locktime
27+
}
28+
2029
f.inputs.forEach(function (input) {
2130
var prevTxScript
2231

@@ -46,15 +55,6 @@ function construct (f, sign) {
4655
})
4756
}
4857

49-
// FIXME: add support for locktime/version in TransactionBuilder API
50-
if (f.version !== undefined) {
51-
txb.tx.version = f.version
52-
}
53-
54-
if (f.locktime !== undefined) {
55-
txb.tx.locktime = f.locktime
56-
}
57-
5858
return txb
5959
}
6060

0 commit comments

Comments
 (0)