Browse Source

add address data to notification

activeAddress
Ivan Socolsky 10 years ago
parent
commit
af98e5af96
  1. 4
      lib/server.js
  2. 5
      test/integration/server.js

4
lib/server.js

@ -284,7 +284,9 @@ WalletService.prototype.createAddress = function(opts, cb) {
self.storage.storeAddressAndWallet(wallet, address, function(err) {
if (err) return cb(err);
self._notify('NewAddress');
self._notify('NewAddress', {
address: address.address,
});
return cb(null, address);
});
});

5
test/integration/server.js

@ -601,7 +601,7 @@ describe('Copay server', function() {
});
});
it.only('should create address', function(done) {
it('should create address', function(done) {
server.createAddress({}, function(err, address) {
should.not.exist(err);
address.should.exist;
@ -614,8 +614,7 @@ describe('Copay server', function() {
type: 'NewAddress'
});
should.exist(notif);
notif.length.should.equal(1);
notif[0].data.address.should.equal('3KxttbKQQPWmpsnXZ3rB4mgJTuLnVR7frg');
notif.data.address.should.equal('3KxttbKQQPWmpsnXZ3rB4mgJTuLnVR7frg');
done();
});
});

Loading…
Cancel
Save