File tree Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 5757 "async" : " ^0.9.0" ,
5858 "browserify" : " ^10.0.0" ,
5959 "bs58" : " ^2.0.1" ,
60- "cb-helloblock" : " ^0.4.13" ,
60+ "cb-blockr" : " ^3.1.1" ,
61+ "cb-insight" : " git://github.com/weilu/cb-insight" ,
6162 "coveralls" : " ^2.11.2" ,
6263 "istanbul" : " ^0.3.5" ,
6364 "mocha" : " ^2.2.0" ,
Original file line number Diff line number Diff line change 22
33var assert = require ( 'assert' )
44var bitcoin = require ( '../../' )
5- var blockchain = new ( require ( 'cb-helloblock' ) ) ( 'testnet' )
5+ var blockchain = new ( require ( 'cb-insight' ) ) ( 'https://test-insight.bitpay.com' )
6+ var faucetWithdraw = require ( './utils' ) . faucetWithdraw
67
78describe ( 'bitcoinjs-lib (advanced)' , function ( ) {
89 it ( 'can sign a Bitcoin message' , function ( ) {
@@ -29,7 +30,7 @@ describe('bitcoinjs-lib (advanced)', function () {
2930 } )
3031 var address = keyPair . getAddress ( ) . toString ( )
3132
32- blockchain . addresses . __faucetWithdraw ( address , 2e4 , function ( err ) {
33+ faucetWithdraw ( address , 2e4 , function ( err ) {
3334 if ( err ) return done ( err )
3435
3536 blockchain . addresses . unspents ( address , function ( err , unspents ) {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ var assert = require('assert')
44var async = require ( 'async' )
55var bigi = require ( 'bigi' )
66var bitcoin = require ( '../../' )
7- var blockchain = new ( require ( 'cb-helloblock ' ) ) ( 'bitcoin' )
7+ var blockchain = new ( require ( 'cb-blockr ' ) ) ( 'bitcoin' )
88var crypto = require ( 'crypto' )
99
1010describe ( 'bitcoinjs-lib (crypto)' , function ( ) {
Original file line number Diff line number Diff line change 22
33var assert = require ( 'assert' )
44var bitcoin = require ( '../../' )
5- var blockchain = new ( require ( 'cb-helloblock' ) ) ( 'testnet' )
5+ var blockchain = new ( require ( 'cb-insight' ) ) ( 'https://test-insight.bitpay.com' )
6+ var faucetWithdraw = require ( './utils' ) . faucetWithdraw
67
78describe ( 'bitcoinjs-lib (multisig)' , function ( ) {
89 it ( 'can create a 2-of-3 multisig P2SH address' , function ( ) {
@@ -37,7 +38,7 @@ describe('bitcoinjs-lib (multisig)', function () {
3738 var address = bitcoin . Address . fromOutputScript ( scriptPubKey , bitcoin . networks . testnet ) . toString ( )
3839
3940 // Attempt to send funds to the source address
40- blockchain . addresses . __faucetWithdraw ( address , 2e4 , function ( err ) {
41+ faucetWithdraw ( address , 2e4 , function ( err ) {
4142 if ( err ) return done ( err )
4243
4344 // get latest unspents from the address
Original file line number Diff line number Diff line change 1+ var https = require ( 'https' )
2+
3+ function faucetWithdraw ( address , amount , done ) {
4+ var url = "https://coconut-macaroon.herokuapp.com/bitcoin/testnet/withdrawal?address=" + address + "&amount=" + amount
5+ https . get ( url , function ( res ) {
6+ res . statusCode == 200 ? done ( null ) : done ( new Error ( "non-200 status: " + res . statusCode ) )
7+ } ) . on ( 'error' , done )
8+ }
9+
10+ module . exports = {
11+ faucetWithdraw : faucetWithdraw
12+ }
You can’t perform that action at this time.
0 commit comments