diff --git a/js/models/core/TxProposal.js b/js/models/core/TxProposal.js index 739283b47..3ddeac22e 100644 --- a/js/models/core/TxProposal.js +++ b/js/models/core/TxProposal.js @@ -11,7 +11,7 @@ var buffertools = bitcore.buffertools; var preconditions = require('preconditions').instance(); var VERSION = 1; -var CORE_FIELDS = ['builderObj', 'inputChainPaths', 'version']; +var CORE_FIELDS = ['builderObj', 'inputChainPaths', 'version', 'comment']; function TxProposal(opts) { diff --git a/test/mocks/FakeBlockchain.js b/test/mocks/FakeBlockchain.js index d47b44af6..e4c3997bc 100644 --- a/test/mocks/FakeBlockchain.js +++ b/test/mocks/FakeBlockchain.js @@ -1,6 +1,5 @@ 'use strict'; -var imports = require('soop').imports(); var bitcore = require('bitcore'); function FakeBlockchain(opts) { @@ -47,4 +46,4 @@ FakeBlockchain.prototype.sendRawTransaction = function(rawtx, cb) { return cb(txid); }; -module.exports = require('soop')(FakeBlockchain); +module.exports = FakeBlockchain; diff --git a/test/test.TxProposal.js b/test/test.TxProposal.js index 046930695..3ac2f310d 100644 --- a/test/test.TxProposal.js +++ b/test/test.TxProposal.js @@ -98,11 +98,13 @@ describe('TxProposal', function() { createdTs: 1, builder: b, inputChainPaths: 'm/1', + comment: 'hola', }); var o = txp.toObjTrim(); should.exist(o); should.not.exist(o.creator); should.not.exist(o.builder); + should.exist(o.comment); should.exist(o.builderObj); }); @@ -256,7 +258,7 @@ describe('TxProposal', function() { it('with less signatures', function() { var backup = txp.builder.vanilla.scriptSig[0]; txp.builder.merge = function() { - // 3 signatures. + // 2 signatures. this.vanilla.scriptSig = ['0048304502207d8e832bd576c93300e53ab6cbd68641961bec60690c358fd42d8e42b7d7d687022100a1daa89923efdb4c9b615d065058d9e1644f67000694a7d0806759afa7bef19b014cad532103197599f6e209cefef07da2fddc6fe47715a70162c531ffff8e611cef23dfb70d210380a29968851f93af55e581c43d9ef9294577a439a3ca9fc2bc47d1ca2b3e9127210392dccb2ed470a45984811d6402fdca613c175f8f3e4eb8e2306e8ccd7d0aed032103a94351fecc4328bb683bf93a1aa67378374904eac5980c7966723a51897c56e32103e085eb6fa1f20b2722c16161144314070a2c316a9cae2489fd52ce5f63fff6e455ae']; this.tx.ins[0].s = new Buffer(this.vanilla.scriptSig[0], 'hex'); }; diff --git a/test/test.TxProposals.js b/test/test.TxProposals.js index a27258c5f..a7a25e727 100644 --- a/test/test.TxProposals.js +++ b/test/test.TxProposals.js @@ -106,9 +106,10 @@ describe('TxProposals', function() { }); }); describe.skip('#merge', function() { - it('mergeFromObj', function() { + it('should merge', function() { var txps = new TxProposals(); - txps.mergeFromObj(dummyProposal.toObj()); + var d = dummyProposal; + txps.merge(d.toObj(),{}); }); }); });