Changes internal serialization to use Buffers instead

This commit is contained in:
Daniel Cousens 2014-05-02 06:36:21 +10:00
commit a8cf2fdd9e
5 changed files with 123 additions and 78 deletions

View file

@ -72,7 +72,7 @@ describe('Transaction', function() {
it('assigns hash to deserialized object', function(){
var hashHex = "a9d4599e15b53f3eb531608ddb31f48c695c3d0b3538a6bda871e8b34f2f430c"
assert.equal(b2h(tx.hash), hashHex)
assert.equal(tx.hash, hashHex)
})
it('decodes large inputs correctly', function() {

View file

@ -4,7 +4,6 @@ var T = require('../src/transaction.js')
var Transaction = T.Transaction
var TransactionOut = T.TransactionOut
var Script = require('../src/script.js')
var convert = require('../src/convert.js')
var assert = require('assert')
var sinon = require('sinon')
var crypto = require('../').crypto
@ -338,7 +337,7 @@ describe('Wallet', function() {
function verifyOutputAdded(index) {
var txOut = tx.outs[index]
var key = convert.bytesToHex(tx.getHash()) + ":" + index
var key = tx.getHash() + ":" + index
var output = wallet.outputs[key]
assert.equal(output.receive, key)
assert.equal(output.value, txOut.value)
@ -367,7 +366,7 @@ describe('Wallet', function() {
var key = txIn.outpoint.hash + ":" + txIn.outpoint.index
var output = wallet.outputs[key]
assert.equal(output.spend, convert.bytesToHex(tx.getHash()) + ':' + 0)
assert.equal(output.spend, tx.getHash() + ':' + 0)
})
})