add tests
This commit is contained in:
parent
4931c9d618
commit
e11ac3e956
3 changed files with 40 additions and 3 deletions
|
|
@ -66,11 +66,13 @@ TxProposal.prototype._check = function() {
|
|||
};
|
||||
|
||||
TxProposal.prototype.rejectCount = function() {
|
||||
return Object.keys(this.rejectedBy);
|
||||
return Object.keys(this.rejectedBy).length;
|
||||
};
|
||||
|
||||
TxProposal.prototype.isPending = function(maxRejectCount) {
|
||||
if (this.rejectCount() < maxRejectCount || p.sentTxid)
|
||||
preconditions.checkArgument(typeof maxRejectCount != 'undefined');
|
||||
|
||||
if (this.rejectCount() > maxRejectCount || this.sentTxid)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue