Add additional livenet tests and remove used param.
This commit is contained in:
parent
1c615ac7c0
commit
dcaa6203e9
|
@ -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);
|
||||
|
|
|
@ -3,6 +3,14 @@
|
|||
{
|
||||
"txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
|
||||
"outputIndex": 0
|
||||
},
|
||||
{
|
||||
"txid": "64b2da257d93ab44d19ef9b374788d82b6885bc3fb3c17704f42f09b1096e982",
|
||||
"outputIndex": 0
|
||||
},
|
||||
{
|
||||
"txid": "226bbc4b1f851857f37aa96e9eb702946fc128b055e4decc684740005f5044cf",
|
||||
"outputIndex": 0
|
||||
}
|
||||
],
|
||||
"spent": [
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue