use blockchain.info for 3PBP address example

This commit is contained in:
Daniel Cousens 2018-06-21 13:31:40 +10:00
parent e50679d2c3
commit bc7ca710ed

View file

@ -115,21 +115,19 @@ describe('bitcoinjs-lib (addresses)', function () {
}) })
it('can support the retrieval of transactions for an address (via 3PBP)', function (done) { it('can support the retrieval of transactions for an address (via 3PBP)', function (done) {
var keyPair = bitcoin.ECPair.makeRandom() const keyPair = bitcoin.ECPair.makeRandom()
var address = getAddress(keyPair) const address = getAddress(keyPair)
dhttp({ dhttp({
method: 'POST', method: 'GET',
url: 'https://api.ei8ht.com.au/3/addrtxs', url: 'https://blockchain.info/rawaddr/' + address
body: { }, function (err, result) {
addrs: [address],
height: 0
}
}, function (err, transactions) {
if (err) return done(err) if (err) return done(err)
// random private keys [probably] have no transactions // random private keys [probably!] have no transactions
assert.strictEqual(Object.keys(transactions).length, 0) assert.strictEqual(result.n_tx, 0)
assert.strictEqual(result.total_received, 0)
assert.strictEqual(result.total_sent, 0)
done() done()
}) })
}) })