replace helloblock with insight and blockr
This commit is contained in:
parent
88cc90481f
commit
a2b4558a0b
5 changed files with 21 additions and 6 deletions
|
@ -57,7 +57,8 @@
|
|||
"async": "^0.9.0",
|
||||
"browserify": "^10.0.0",
|
||||
"bs58": "^2.0.1",
|
||||
"cb-helloblock": "^0.4.13",
|
||||
"cb-blockr": "^3.1.1",
|
||||
"cb-insight": "git://github.com/weilu/cb-insight",
|
||||
"coveralls": "^2.11.2",
|
||||
"istanbul": "^0.3.5",
|
||||
"mocha": "^2.2.0",
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
var assert = require('assert')
|
||||
var bitcoin = require('../../')
|
||||
var blockchain = new (require('cb-helloblock'))('testnet')
|
||||
var blockchain = new (require('cb-insight'))('https://test-insight.bitpay.com')
|
||||
var faucetWithdraw = require('./utils').faucetWithdraw
|
||||
|
||||
describe('bitcoinjs-lib (advanced)', function () {
|
||||
it('can sign a Bitcoin message', function () {
|
||||
|
@ -29,7 +30,7 @@ describe('bitcoinjs-lib (advanced)', function () {
|
|||
})
|
||||
var address = keyPair.getAddress().toString()
|
||||
|
||||
blockchain.addresses.__faucetWithdraw(address, 2e4, function (err) {
|
||||
faucetWithdraw(address, 2e4, function (err) {
|
||||
if (err) return done(err)
|
||||
|
||||
blockchain.addresses.unspents(address, function (err, unspents) {
|
||||
|
|
|
@ -4,7 +4,7 @@ var assert = require('assert')
|
|||
var async = require('async')
|
||||
var bigi = require('bigi')
|
||||
var bitcoin = require('../../')
|
||||
var blockchain = new (require('cb-helloblock'))('bitcoin')
|
||||
var blockchain = new (require('cb-blockr'))('bitcoin')
|
||||
var crypto = require('crypto')
|
||||
|
||||
describe('bitcoinjs-lib (crypto)', function () {
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
var assert = require('assert')
|
||||
var bitcoin = require('../../')
|
||||
var blockchain = new (require('cb-helloblock'))('testnet')
|
||||
var blockchain = new (require('cb-insight'))('https://test-insight.bitpay.com')
|
||||
var faucetWithdraw = require('./utils').faucetWithdraw
|
||||
|
||||
describe('bitcoinjs-lib (multisig)', function () {
|
||||
it('can create a 2-of-3 multisig P2SH address', function () {
|
||||
|
@ -37,7 +38,7 @@ describe('bitcoinjs-lib (multisig)', function () {
|
|||
var address = bitcoin.Address.fromOutputScript(scriptPubKey, bitcoin.networks.testnet).toString()
|
||||
|
||||
// Attempt to send funds to the source address
|
||||
blockchain.addresses.__faucetWithdraw(address, 2e4, function (err) {
|
||||
faucetWithdraw(address, 2e4, function (err) {
|
||||
if (err) return done(err)
|
||||
|
||||
// get latest unspents from the address
|
||||
|
|
12
test/integration/utils.js
Normal file
12
test/integration/utils.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
var https = require('https')
|
||||
|
||||
function faucetWithdraw(address, amount, done) {
|
||||
var url = "https://coconut-macaroon.herokuapp.com/bitcoin/testnet/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)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
faucetWithdraw: faucetWithdraw
|
||||
}
|
Loading…
Add table
Reference in a new issue