From 4cf152999aae419a23697a969bb631387a68dab6 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 4 Aug 2014 07:16:09 -0300 Subject: [PATCH] add seenBy on creator --- js/models/core/TxProposal.js | 3 +-- test/test.TxProposal.js | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/models/core/TxProposal.js b/js/models/core/TxProposal.js index 85420245f..e0e5c1674 100644 --- a/js/models/core/TxProposal.js +++ b/js/models/core/TxProposal.js @@ -271,7 +271,7 @@ TxProposal.prototype.setCopayers = function(senderId, keyMap, readOnlyPeers) { // from senderId, and must be signed by senderId if (isNew) { this.creator = Object.keys(newCopayer)[0]; - this.createdTs = Date.now(); + this.seenBy[this.creator] = this.createdTs = Date.now(); } //Ended. Update this. @@ -283,7 +283,6 @@ TxProposal.prototype.setCopayers = function(senderId, keyMap, readOnlyPeers) { for(var i in this.signedBy) { delete this.rejectedBy[i]; } - console.log('[TxProposal.js.287:newCopayer:]',newCopayer); //TODO return Object.keys(newCopayer); }; diff --git a/test/test.TxProposal.js b/test/test.TxProposal.js index 33c671519..18cc67ccb 100644 --- a/test/test.TxProposal.js +++ b/test/test.TxProposal.js @@ -363,6 +363,7 @@ describe('TxProposal', function() { Object.keys(txp.signedBy).length.should.equal(1); txp.creator.should.equal('creator'); txp.createdTs.should.gte(ts); + txp.seenBy['creator'].should.equal(txp.createdTs); }) it("New tx should have only 1 signature", function() { var txp = dummyProposal;