Skip to content

Commit 6fc1273

Browse files
committed
fix ES6 issue, and actually verify the TXO
1 parent 31703e2 commit 6fc1273

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/integration/_regtest.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
var assert = require('assert')
12
var bitcoin = require('../../')
23
var dhttp = require('dhttp/200')
34

@@ -44,7 +45,7 @@ function faucet (address, value, callback) {
4445
function fetch (txId, callback) {
4546
dhttp({
4647
method: 'GET',
47-
url: APIURL + '/t/' + txId
48+
url: APIURL + '/t/' + txId + '/json'
4849
}, callback)
4950
}
5051

@@ -56,12 +57,12 @@ function unspents (address, callback) {
5657
}
5758

5859
function verify (txo, callback) {
59-
let { txId } = txo
60-
61-
fetch(txId, function (err, txHex) {
60+
fetch(txo.txId, function (err, tx) {
6261
if (err) return callback(err)
6362

64-
// TODO: verify address and value
63+
var txoActual = tx.outs[txo.vout]
64+
if (txo.address) assert.strictEqual(txoActual.address, txo.address)
65+
if (txo.value) assert.strictEqual(txoActual.value, txo.value)
6566
callback()
6667
})
6768
}

0 commit comments

Comments
 (0)