method: getTxOutInfo
This commit is contained in:
parent
80f438fbc5
commit
c96b6a7598
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue