From af98e5af9686627c75d2c31faf67c4b631d69436 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Mon, 30 Mar 2015 12:45:43 -0300 Subject: [PATCH] add address data to notification --- lib/server.js | 4 +++- test/integration/server.js | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/server.js b/lib/server.js index 4fcc19a..5be41c2 100644 --- a/lib/server.js +++ b/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); }); }); diff --git a/test/integration/server.js b/test/integration/server.js index 6708669..b06df71 100644 --- a/test/integration/server.js +++ b/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(); }); });