From 4028bd50f27e8a6d2ac2a2fb04f4cdb15ac3e479 Mon Sep 17 00:00:00 2001 From: Wei Lu Date: Sat, 30 May 2015 21:30:37 +0800 Subject: [PATCH] comply with project coding style --- test/integration/utils.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/integration/utils.js b/test/integration/utils.js index 91aafaf..17c3275 100644 --- a/test/integration/utils.js +++ b/test/integration/utils.js @@ -1,18 +1,18 @@ var https = require('https') -function faucetWithdraw(address, amount, done) { - var url = "https://coconut-macaroon.herokuapp.com/withdrawal?address=" + address + "&amount=" + amount - https.get(url, function(res) { - res.statusCode == 200 ? done(null) : done(new Error("non-200 status: " + res.statusCode)) +function faucetWithdraw (address, amount, done) { + var url = 'https://coconut-macaroon.herokuapp.com/withdrawal?address=' + address + '&amount=' + amount + https.get(url, function (res) { + res.statusCode === 200 ? done(null) : done(new Error('non-200 status: ' + res.statusCode)) }).on('error', done) } -function pollUnspent(blockchain, address, done) { +function pollUnspent (blockchain, address, done) { blockchain.addresses.unspents(address, function (err, unspents) { if (err) return done(err) - if(unspents == null || unspents.length === 0) { - return setTimeout(function() { + if (!unspents || unspents.length === 0) { + return setTimeout(function () { pollUnspent(blockchain, address, done) }, 200) } @@ -21,12 +21,12 @@ function pollUnspent(blockchain, address, done) { }) } -function pollSummary(blockchain, address, done) { +function pollSummary (blockchain, address, done) { blockchain.addresses.summary(address, function (err, result) { if (err) return done(err) - if(result.balance == 0) { - return setTimeout(function() { + if (result.balance === 0) { + return setTimeout(function () { pollSummary(blockchain, address, done) }, 200) }