Add size() cardinality helper across modules (eighth pass).
Standardize a size() method after isEmpty() on every module with clearAll(), delegating to domain counts or snapshot fields so callers can query occupancy without parsing snapshots. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -449,6 +449,10 @@ class HyperP2PCausalConsensus extends EventEmitter {
|
||||
return this.proposals.size === 0 && this.decidedOrders.size === 0
|
||||
}
|
||||
|
||||
size () {
|
||||
return this.proposals.size + this.decidedOrders.size
|
||||
}
|
||||
|
||||
async proposeBatch (entries) {
|
||||
if (!Array.isArray(entries)) throw new Error('entries array required')
|
||||
const out = []
|
||||
|
||||
Reference in New Issue
Block a user