tests: rename txid to id in Transaction context

This commit is contained in:
Daniel Cousens 2014-12-13 09:48:31 +11:00
parent ca4e64d071
commit fc690d418b
2 changed files with 10 additions and 10 deletions

View file

@ -2,7 +2,7 @@
"valid": [
{
"description": "Standard transaction (1:1)",
"txid": "a0ff943d3f644d8832b1fa74be4d0ad2577615dc28a7ef74ff8c271b603a082a",
"id": "a0ff943d3f644d8832b1fa74be4d0ad2577615dc28a7ef74ff8c271b603a082a",
"hash": "2a083a601b278cff74efa728dc157657d20a4dbe74fab132884d643f3d94ffa0",
"raw": {
"version": 1,
@ -25,7 +25,7 @@
},
{
"description": "Standard transaction (2:2)",
"txid": "fcdd6d89c43e76dcff94285d9b6e31d5c60cb5e397a76ebc4920befad30907bc",
"id": "fcdd6d89c43e76dcff94285d9b6e31d5c60cb5e397a76ebc4920befad30907bc",
"hash": "bc0709d3fabe2049bc6ea797e3b50cc6d5316e9b5d2894ffdc763ec4896dddfc",
"raw": {
"version": 1,
@ -59,7 +59,7 @@
},
{
"description": "Standard transaction (14:2)",
"txid": "39d57bc27f72e904d81f6b5ef7b4e6e17fa33a06b11e5114a43435830d7b5563",
"id": "39d57bc27f72e904d81f6b5ef7b4e6e17fa33a06b11e5114a43435830d7b5563",
"hash": "63557b0d833534a414511eb1063aa37fe1e6b4f75e6b1fd804e9727fc27bd539",
"raw": {
"version": 1,

View file

@ -30,7 +30,7 @@ describe('Transaction', function() {
describe('fromBuffer/fromHex', function() {
fixtures.valid.forEach(function(f) {
it('imports ' + f.txid + ' correctly', function() {
it('imports ' + f.id + ' correctly', function() {
var actual = Transaction.fromHex(f.hex)
assert.deepEqual(actual.toHex(), f.hex)
@ -48,7 +48,7 @@ describe('Transaction', function() {
describe('toBuffer/toHex', function() {
fixtures.valid.forEach(function(f) {
it('exports ' + f.txid + ' correctly', function() {
it('exports ' + f.id + ' correctly', function() {
var actual = fromRaw(f.raw)
assert.deepEqual(actual.toHex(), f.hex)
@ -109,7 +109,7 @@ describe('Transaction', function() {
})
fixtures.valid.forEach(function(f) {
it('should add the inputs for ' + f.txid + ' correctly', function() {
it('should add the inputs for ' + f.id + ' correctly', function() {
var tx = new Transaction()
f.raw.ins.forEach(function(txIn, i) {
@ -183,7 +183,7 @@ describe('Transaction', function() {
})
fixtures.valid.forEach(function(f) {
it('should add the outputs for ' + f.txid + ' correctly', function() {
it('should add the outputs for ' + f.id + ' correctly', function() {
var tx = new Transaction()
f.raw.outs.forEach(function(txOut, i) {
@ -215,18 +215,18 @@ describe('Transaction', function() {
describe('getId', function() {
fixtures.valid.forEach(function(f) {
it('should return the txid for ' + f.txid, function() {
it('should return the id for ' + f.id, function() {
var tx = Transaction.fromHex(f.hex)
var actual = tx.getId()
assert.equal(actual, f.txid)
assert.equal(actual, f.id)
})
})
})
describe('getHash', function() {
fixtures.valid.forEach(function(f) {
it('should return the hash for ' + f.txid, function() {
it('should return the hash for ' + f.id, function() {
var tx = Transaction.fromHex(f.hex)
var actual = tx.getHash().toString('hex')