@@ -2,13 +2,11 @@ var assert = require('assert')
2
2
var bufferutils = require ( '../src/bufferutils' )
3
3
var crypto = require ( '../src/crypto' )
4
4
var networks = require ( '../src/networks' )
5
- var sinon = require ( 'sinon' )
6
5
var scripts = require ( '../src/scripts' )
7
6
8
7
var Address = require ( '../src/address' )
9
8
var HDNode = require ( '../src/hdnode' )
10
9
var Transaction = require ( '../src/transaction' )
11
- var TransactionBuilder = require ( '../src/transaction_builder' )
12
10
var Wallet = require ( '../src/wallet' )
13
11
14
12
var fixtureTxes = require ( './fixtures/mainnet_tx' )
@@ -642,19 +640,14 @@ describe('Wallet', function() {
642
640
} )
643
641
} )
644
642
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 ( ) {
651
645
var fee = 30000
652
- sinon . spy ( TransactionBuilder . prototype , "sign" )
653
646
654
647
var tx = wallet . createTx ( to , value , { fixedFee : fee } )
655
648
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' )
658
651
} )
659
652
} )
660
653
0 commit comments