method: getTxOutInfo

This commit is contained in:
Gustavo Cortez 2014-01-15 18:05:02 -03:00
parent 80f438fbc5
commit c96b6a7598
2 changed files with 27 additions and 0 deletions

View File

@ -11,6 +11,7 @@ function spec() {
function Status() {
this.info = {};
this.difficulty = {};
this.txoutsetinfo = {};
}
Status.prototype.getInfo = function(next) {
@ -45,6 +46,22 @@ function spec() {
});
};
Status.prototype.getTxOutSetInfo = function(next) {
var that = this;
async.series([
function (cb) {
rpc.getTxOutSetInfo(function(err, txout){
if (err) return cb(err);
that.txoutsetinfo = txout.result;
return cb();
});
}
], function (err) {
return next(err);
});
};
return Status;
}

View File

@ -40,5 +40,15 @@ describe('Status', function(){
});
});
it('getTxOutSetInfo', function(done) {
var d = new Status();
d.getTxOutSetInfo(function(err) {
if (err) done(err);
assert.equal('number', typeof d.txoutsetinfo.txouts);
done();
});
});
});