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) { self.storage.storeAddressAndWallet(wallet, address, function(err) {
if (err) return cb(err); if (err) return cb(err);
self._notify('NewAddress'); self._notify('NewAddress', {
address: address.address,
});
return cb(null, 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) { server.createAddress({}, function(err, address) {
should.not.exist(err); should.not.exist(err);
address.should.exist; address.should.exist;
@ -614,8 +614,7 @@ describe('Copay server', function() {
type: 'NewAddress' type: 'NewAddress'
}); });
should.exist(notif); should.exist(notif);
notif.length.should.equal(1); notif.data.address.should.equal('3KxttbKQQPWmpsnXZ3rB4mgJTuLnVR7frg');
notif[0].data.address.should.equal('3KxttbKQQPWmpsnXZ3rB4mgJTuLnVR7frg');
done(); done();
}); });
}); });

Loading…
Cancel
Save