Browse Source

Merge pull request #582 from isocolsky/ref/edit-note

Return txNote after edit
activeAddress
Matias Alejo Garcia 8 years ago
committed by GitHub
parent
commit
d73f70bc32
  1. 5
      lib/server.js
  2. 12
      test/integration/server.js

5
lib/server.js

@ -2068,7 +2068,10 @@ WalletService.prototype.editTxNote = function(opts, cb) {
} else { } else {
note.edit(opts.body, self.copayerId); note.edit(opts.body, self.copayerId);
} }
self.storage.storeTxNote(note, cb); self.storage.storeTxNote(note, function(err) {
if (err) return cb(err);
self.storage.fetchTxNote(self.walletId, opts.txid, cb);
});
}); });
}); });
}; };

12
test/integration/server.js

@ -3761,19 +3761,21 @@ describe('Wallet service', function() {
server.editTxNote({ server.editTxNote({
txid: '123', txid: '123',
body: 'note body' body: 'note body'
}, function(err) { }, function(err, note) {
should.not.exist(err); should.not.exist(err);
note.txid.should.equal('123');
note.walletId.should.equal(wallet.id);
note.body.should.equal('note body');
note.editedBy.should.equal(server.copayerId);
note.editedByName.should.equal('copayer 1');
note.createdOn.should.equal(note.editedOn);
server.getTxNote({ server.getTxNote({
txid: '123', txid: '123',
}, function(err, note) { }, function(err, note) {
should.not.exist(err); should.not.exist(err);
should.exist(note); should.exist(note);
note.txid.should.equal('123');
note.walletId.should.equal(wallet.id);
note.body.should.equal('note body'); note.body.should.equal('note body');
note.editedBy.should.equal(server.copayerId); note.editedBy.should.equal(server.copayerId);
note.editedByName.should.equal('copayer 1');
note.createdOn.should.equal(note.editedOn);
done(); done();
}); });
}); });

Loading…
Cancel
Save