split long lines

This commit is contained in:
Ivan Socolsky 2015-02-11 12:10:47 -03:00
parent 86b51f6501
commit 9d3001434b
1 changed files with 12 additions and 6 deletions

View File

@ -88,7 +88,8 @@ CopayServer.prototype.createWallet = function(opts, cb) {
var self = this, var self = this,
pubKey; pubKey;
if (!Utils.checkRequired(opts, ['name', 'm', 'n', 'pubKey'])) return cb(new ClientError('Required argument missing')); if (!Utils.checkRequired(opts, ['name', 'm', 'n', 'pubKey']))
return cb(new ClientError('Required argument missing'));
if (_.isEmpty(opts.name)) return cb(new ClientError('Invalid wallet name')); if (_.isEmpty(opts.name)) return cb(new ClientError('Invalid wallet name'));
if (!Wallet.verifyCopayerLimits(opts.m, opts.n)) if (!Wallet.verifyCopayerLimits(opts.m, opts.n))
@ -154,7 +155,8 @@ CopayServer.prototype._verifySignature = function(text, signature, pubKey) {
CopayServer.prototype.joinWallet = function(opts, cb) { CopayServer.prototype.joinWallet = function(opts, cb) {
var self = this; var self = this;
if (!Utils.checkRequired(opts, ['walletId', 'name', 'xPubKey', 'xPubKeySignature'])) return cb(new ClientError('Required argument missing')); if (!Utils.checkRequired(opts, ['walletId', 'name', 'xPubKey', 'xPubKeySignature']))
return cb(new ClientError('Required argument missing'));
if (_.isEmpty(opts.name)) return cb(new ClientError('Invalid copayer name')); if (_.isEmpty(opts.name)) return cb(new ClientError('Invalid copayer name'));
@ -236,7 +238,8 @@ CopayServer.prototype.getAddresses = function(opts, cb) {
CopayServer.prototype.verifyMessageSignature = function(opts, cb) { CopayServer.prototype.verifyMessageSignature = function(opts, cb) {
var self = this; var self = this;
if (!Utils.checkRequired(opts, ['message', 'signature'])) return cb(new ClientError('Required argument missing')); if (!Utils.checkRequired(opts, ['message', 'signature']))
return cb(new ClientError('Required argument missing'));
self.getWallet({}, function(err, wallet) { self.getWallet({}, function(err, wallet) {
if (err) return cb(err); if (err) return cb(err);
@ -389,7 +392,8 @@ CopayServer.prototype._selectUtxos = function(txp, utxos) {
CopayServer.prototype.createTx = function(opts, cb) { CopayServer.prototype.createTx = function(opts, cb) {
var self = this; var self = this;
if (!Utils.checkRequired(opts, ['toAddress', 'amount'])) return cb(new ClientError('Required argument missing')); if (!Utils.checkRequired(opts, ['toAddress', 'amount']))
return cb(new ClientError('Required argument missing'));
Utils.runLocked(self.walletId, cb, function(cb) { Utils.runLocked(self.walletId, cb, function(cb) {
self.getWallet({}, function(err, wallet) { self.getWallet({}, function(err, wallet) {
@ -536,7 +540,8 @@ CopayServer.prototype._broadcastTx = function(txp, cb) {
CopayServer.prototype.signTx = function(opts, cb) { CopayServer.prototype.signTx = function(opts, cb) {
var self = this; var self = this;
if (!Utils.checkRequired(opts, ['txProposalId', 'signatures'])) return cb(new ClientError('Required argument missing')); if (!Utils.checkRequired(opts, ['txProposalId', 'signatures']))
return cb(new ClientError('Required argument missing'));
self.getWallet({}, function(err, wallet) { self.getWallet({}, function(err, wallet) {
if (err) return cb(err); if (err) return cb(err);
@ -592,7 +597,8 @@ CopayServer.prototype.signTx = function(opts, cb) {
CopayServer.prototype.rejectTx = function(opts, cb) { CopayServer.prototype.rejectTx = function(opts, cb) {
var self = this; var self = this;
if (!Utils.checkRequired(opts, ['txProposalId'])) return cb(new ClientError('Required argument missing')); if (!Utils.checkRequired(opts, ['txProposalId']))
return cb(new ClientError('Required argument missing'));
self.getTx({ self.getTx({
id: opts.txProposalId id: opts.txProposalId