Browse Source

return txnote after edit

activeAddress
Ivan Socolsky 8 years ago
parent
commit
c4b293ed3a
No known key found for this signature in database GPG Key ID: FAECE6A05FAA4F56
  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 {
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({
txid: '123',
body: 'note body'
}, function(err) {
}, function(err, note) {
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({
txid: '123',
}, function(err, note) {
should.not.exist(err);
should.exist(note);
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);
done();
});
});

Loading…
Cancel
Save