Browse Source

tests: add coinbase with witness transaction fixture

hk-custom-address
Daniel Cousens 8 years ago
committed by Daniel Cousens
parent
commit
771491bc5a
  1. 33
      test/fixtures/transaction.json
  2. 2
      test/transaction.js

33
test/fixtures/transaction.json

@ -620,6 +620,39 @@
"locktime": 0
},
"coinbase": false
},
{
"description": "Coinbase transaction w/ witness",
"id": "c881f7b084a367b0603abbcb9c5c639318e6166770e3f9b27a1ee3f8b6a16517",
"hash": "1765a1b6f8e31e7ab2f9e3706716e61893635c9ccbbb3a60b067a384b0f781c8",
"hex": "02000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05022b020101ffffffff02c0cf402500000000232103c6c5964853fd00fb3271ac002831c66825102d223c706ce0ee99e73db3be4aa1ac0000000000000000266a24aa21a9edff828eb21f40ab251d9f107792670aba9299028b894a364fda570f6a089dcfe900000000",
"whex": "020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff05022b020101ffffffff02c0cf402500000000232103c6c5964853fd00fb3271ac002831c66825102d223c706ce0ee99e73db3be4aa1ac0000000000000000266a24aa21a9edff828eb21f40ab251d9f107792670aba9299028b894a364fda570f6a089dcfe90120000000000000000000000000000000000000000000000000000000000000000000000000",
"raw": {
"version": 2,
"ins": [
{
"hash": "0000000000000000000000000000000000000000000000000000000000000000",
"index": 4294967295,
"data": "022b020101",
"sequence": 4294967295,
"witness": [
"0000000000000000000000000000000000000000000000000000000000000000"
]
}
],
"outs": [
{
"script": "03c6c5964853fd00fb3271ac002831c66825102d223c706ce0ee99e73db3be4aa1 OP_CHECKSIG",
"value": 625004480
},
{
"script": "OP_RETURN aa21a9edff828eb21f40ab251d9f107792670aba9299028b894a364fda570f6a089dcfe9",
"value": 0
}
],
"locktime": 0
},
"coinbase": true
}
],
"hashForSignature": [

2
test/transaction.js

@ -204,7 +204,7 @@ describe('Transaction', function () {
describe('isCoinbase', function () {
function verify (f) {
it('should return ' + f.coinbase + ' for ' + f.id, function () {
it('should return ' + f.coinbase + ' for ' + f.id + '(' + f.description + ')', function () {
var tx = Transaction.fromHex(f.hex)
assert.strictEqual(tx.isCoinbase(), f.coinbase)

Loading…
Cancel
Save