Add additional livenet tests and remove used param.

This commit is contained in:
Braydon Fuller 2015-07-15 19:38:19 -04:00
parent 1c615ac7c0
commit dcaa6203e9
4 changed files with 13 additions and 8 deletions

View File

@ -62,7 +62,7 @@ describe('Basic Functionality', function() {
});
});
describe.only('determine if outpoint is unspent/spent', function() {
describe('determine if outpoint is unspent/spent', function() {
spentData.forEach(function(data) {
it('for spent txid ' + data.txid + ' and output ' + data.outputIndex, function() {
var spent = bitcoind.isSpent(data.txid, data.outputIndex, true);

View File

@ -3,6 +3,14 @@
{
"txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
"outputIndex": 0
},
{
"txid": "64b2da257d93ab44d19ef9b374788d82b6885bc3fb3c17704f42f09b1096e982",
"outputIndex": 0
},
{
"txid": "226bbc4b1f851857f37aa96e9eb702946fc128b055e4decc684740005f5044cf",
"outputIndex": 0
}
],
"spent": [

View File

@ -323,8 +323,8 @@ Bitcoin.prototype.getBlockHeight = function(height, callback) {
});
};
Bitcoin.prototype.isSpent = function(txid, outputIndex, queryMempool) {
return bitcoindjs.isSpent(txid, outputIndex, queryMempool);
Bitcoin.prototype.isSpent = function(txid, outputIndex) {
return bitcoindjs.isSpent(txid, outputIndex);
};
Bitcoin.prototype.getTransaction =

View File

@ -939,18 +939,15 @@ async_get_tx_after(uv_work_t *req) {
NAN_METHOD(IsSpent) {
NanScope();
if (args.Length() > 3) {
if (args.Length() > 2) {
return NanThrowError(
"Usage: bitcoindjs.isSpent(txid, outputIndex, queryMempool)");
"Usage: bitcoindjs.isSpent(txid, outputIndex)");
}
// XXX: include the mempool in the coins viewcache
String::Utf8Value arg(args[0]->ToString());
std::string argStr = std::string(*arg);
const uint256 txid = uint256S(argStr);
int outputIndex = args[1]->IntegerValue();
bool queryMempool = args[2]->BooleanValue();
CCoinsView dummy;
CCoinsViewCache view(&dummy);