add seenBy on creator

This commit is contained in:
Matias Alejo Garcia 2014-08-04 07:16:09 -03:00
parent f5f9848ff1
commit 4cf152999a
2 changed files with 2 additions and 2 deletions

View File

@ -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);
};

View File

@ -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;