From c3a3f17ef00425f6032a450265924a7b344b7863 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 24 Jul 2015 13:54:41 +1000 Subject: [PATCH] use BlockTrail for testnet faucet --- package.json | 1 + test/integration/utils.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e500c2f..136e7a2 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "cb-blockr": "^3.1.1", "cb-insight": "git://github.com/weilu/cb-insight", "coveralls": "^2.11.2", + "httpify": "^1.0.0", "istanbul": "^0.3.5", "mocha": "^2.2.0", "proxyquire": "^1.4.0", diff --git a/test/integration/utils.js b/test/integration/utils.js index 17c3275..92ed683 100644 --- a/test/integration/utils.js +++ b/test/integration/utils.js @@ -1,10 +1,15 @@ -var https = require('https') +var httpify = require('httpify') -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 faucetWithdraw (address, amount, callback) { + httpify({ + method: 'POST', + url: 'https://api.blocktrail.com/v1/tBTC/faucet/withdrawl?api_key=c0bd8155c66e3fb148bb1664adc1e4dacd872548', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + address: address, + amount: amount + }) + }, callback) } function pollUnspent (blockchain, address, done) {