|
|
@ -104,6 +104,7 @@ helpers.createAndJoinWallet = function(m, n, opts, cb) { |
|
|
|
name: 'copayer ' + (i + 1), |
|
|
|
xPubKey: TestData.copayers[i + offset].xPubKey_45H, |
|
|
|
requestPubKey: TestData.copayers[i + offset].pubKey_1H_0, |
|
|
|
customData: 'custom data ' + (i + 1), |
|
|
|
}); |
|
|
|
|
|
|
|
server.joinWallet(copayerOpts, function(err, result) { |
|
|
@ -912,6 +913,7 @@ describe('Wallet service', function() { |
|
|
|
name: 'me', |
|
|
|
xPubKey: TestData.copayers[0].xPubKey_45H, |
|
|
|
requestPubKey: TestData.copayers[0].pubKey_1H_0, |
|
|
|
customData: 'dummy custom data', |
|
|
|
}); |
|
|
|
server.joinWallet(copayerOpts, function(err, result) { |
|
|
|
should.not.exist(err); |
|
|
@ -923,6 +925,7 @@ describe('Wallet service', function() { |
|
|
|
var copayer = wallet.copayers[0]; |
|
|
|
copayer.name.should.equal('me'); |
|
|
|
copayer.id.should.equal(copayerId); |
|
|
|
copayer.customData.should.equal('dummy custom data'); |
|
|
|
server.getNotifications({}, function(err, notifications) { |
|
|
|
should.not.exist(err); |
|
|
|
var notif = _.find(notifications, { |
|
|
@ -1117,7 +1120,7 @@ describe('Wallet service', function() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe.only('#getStatus', function() { |
|
|
|
describe('#getStatus', function() { |
|
|
|
var server, wallet; |
|
|
|
beforeEach(function(done) { |
|
|
|
helpers.createAndJoinWallet(1, 1, function(s, w) { |
|
|
@ -1144,12 +1147,14 @@ describe('Wallet service', function() { |
|
|
|
should.not.exist(status.wallet.publicKeyRing); |
|
|
|
should.not.exist(status.wallet.pubKey); |
|
|
|
should.not.exist(status.wallet.addressManager); |
|
|
|
should.not.exist(status.wallet.copayers[0].xPubKey); |
|
|
|
should.not.exist(status.wallet.copayers[0].requestPubKey); |
|
|
|
should.not.exist(status.wallet.copayers[0].signature); |
|
|
|
should.not.exist(status.wallet.copayers[0].requestPubKey); |
|
|
|
should.not.exist(status.wallet.copayers[0].addressManager); |
|
|
|
|
|
|
|
_.each(status.wallet.copayers, function(copayer) { |
|
|
|
should.not.exist(copayer.xPubKey); |
|
|
|
should.not.exist(copayer.requestPubKey); |
|
|
|
should.not.exist(copayer.signature); |
|
|
|
should.not.exist(copayer.requestPubKey); |
|
|
|
should.not.exist(copayer.addressManager); |
|
|
|
should.not.exist(copayer.customData); |
|
|
|
}); |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -1167,7 +1172,11 @@ describe('Wallet service', function() { |
|
|
|
should.exist(status.wallet.copayers[0].signature); |
|
|
|
should.exist(status.wallet.copayers[0].requestPubKey); |
|
|
|
should.exist(status.wallet.copayers[0].addressManager); |
|
|
|
|
|
|
|
should.exist(status.wallet.copayers[0].customData); |
|
|
|
// Do not return other copayer's custom data
|
|
|
|
_.each(_.rest(status.wallet.copayers), function(copayer) { |
|
|
|
should.not.exist(copayer.customData); |
|
|
|
}); |
|
|
|
done(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -1593,7 +1602,8 @@ describe('Wallet service', function() { |
|
|
|
it('should be able to re-gain access from xPrivKey', function(done) { |
|
|
|
ws.addAccess(opts, function(err, res) { |
|
|
|
should.not.exist(err); |
|
|
|
server.getBalance(res.wallet.walletId, function(err, bal) { should.not.exist(err); |
|
|
|
server.getBalance(res.wallet.walletId, function(err, bal) { |
|
|
|
should.not.exist(err); |
|
|
|
bal.totalAmount.should.equal(1e8); |
|
|
|
getAuthServer(opts.copayerId, reqPrivKey, function(err, server2) { |
|
|
|
server2.getBalance(res.wallet.walletId, function(err, bal2) { |
|
|
|