tests: add coinbase with witness transaction fixture
This commit is contained in:
parent
46c87afa3f
commit
771491bc5a
2 changed files with 34 additions and 1 deletions
33
test/fixtures/transaction.json
vendored
33
test/fixtures/transaction.json
vendored
|
@ -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": [
|
||||
|
|
|
@ -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…
Add table
Reference in a new issue