Skip to content

Commit 166f2c4

Browse files
committed
tests: remove sinon, breaks in weird circumstances
1 parent c3f8869 commit 166f2c4

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

test/wallet.js

+4-11
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ var assert = require('assert')
22
var bufferutils = require('../src/bufferutils')
33
var crypto = require('../src/crypto')
44
var networks = require('../src/networks')
5-
var sinon = require('sinon')
65
var scripts = require('../src/scripts')
76

87
var Address = require('../src/address')
98
var HDNode = require('../src/hdnode')
109
var Transaction = require('../src/transaction')
11-
var TransactionBuilder = require('../src/transaction_builder')
1210
var Wallet = require('../src/wallet')
1311

1412
var fixtureTxes = require('./fixtures/mainnet_tx')
@@ -642,19 +640,14 @@ describe('Wallet', function() {
642640
})
643641
})
644642

645-
describe('signing', function() {
646-
afterEach(function() {
647-
TransactionBuilder.prototype.sign.restore()
648-
})
649-
650-
it('signs the inputs with respective keys', function() {
643+
describe('signing', function(){
644+
it('signs the inputs correctly', function(){
651645
var fee = 30000
652-
sinon.spy(TransactionBuilder.prototype, "sign")
653646

654647
var tx = wallet.createTx(to, value, { fixedFee: fee })
655648

656-
assert(TransactionBuilder.prototype.sign.calledWith(0, wallet.getPrivateKeyForAddress(address2)))
657-
assert(TransactionBuilder.prototype.sign.calledWith(1, wallet.getPrivateKeyForAddress(address1)))
649+
// tx.getHash() hashes the resulting signatures, this hash is verified as correct
650+
assert.equal(tx.getId(), 'e0e1359f14e3fff42181f0f945aa966ab539b516bc21da6dc005b539235dbe54')
658651
})
659652
})
660653

0 commit comments

Comments
 (0)