diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index c3163aea7..f64b1d9ad 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -107,7 +107,7 @@ inherits(Wallet, events.EventEmitter); */ Wallet.builderOpts = { lockTime: null, - signhash: bitcore.Transaction.SIGNHASH_ALL, + signhash: bitcore.Transaction.SIGHASH_ALL, fee: undefined, feeSat: undefined, }; diff --git a/test/test.Wallet.js b/test/test.Wallet.js index 4d80895a9..95c461266 100644 --- a/test/test.Wallet.js +++ b/test/test.Wallet.js @@ -205,8 +205,26 @@ describe('Wallet model', function() { f.should.throw(Error); }); - it('#create, 1 sign', function() { + it('#create, check builder opts', function() { + var w = cachedCreateW2(); + unspentTest[0].address = w.publicKeyRing.getAddress(1, true, w.publicKey).toString(); + unspentTest[0].scriptPubKey = w.publicKeyRing.getScriptPubKeyHex(1, true, w.publicKey); + var ntxid = w.createTxSync( + 'mgGJEugdPnvhmRuFdbdQcFfoFLc1XXeB79', + '123456789', + null, + unspentTest + ); + var t = w.txProposals; + var opts = JSON.parse(t.txps[ntxid].builder.vanilla.opts); + opts.signhash.should.equal(1); + (opts.lockTime===null).should.be.true; + should.not.exist(opts.fee); + should.not.exist(opts.feeSat); + }); + + it('#create, 1 sign', function() { var w = cachedCreateW2(); unspentTest[0].address = w.publicKeyRing.getAddress(1, true, w.publicKey).toString();