Compare commits

..

No commits in common. "master" and "v1.0.0" have entirely different histories.

2 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,7 @@ const p = (fn) => (...args) => {
* @typedef {import('pzp-db').RecPresent} RecPresent * @typedef {import('pzp-db').RecPresent} RecPresent
* @typedef {import('pzp-db').Tangle} Tangle * @typedef {import('pzp-db').Tangle} Tangle
* @typedef {import('pzp-db').Msg} Msg * @typedef {import('pzp-db').Msg} Msg
* @typedef {import('pzp-db/db-tangle')} DBTangle * @typedef {NonNullable<ReturnType<PZPDB['getTangle']>>} DBTangle
* @typedef {string} MsgID * @typedef {string} MsgID
* @typedef {'none'|'all'|`newest-${number}`|'dict'|'set'} GoalDSL * @typedef {'none'|'all'|`newest-${number}`|'dict'|'set'} GoalDSL
* @typedef {'none'|'all'|'newest'|'dict'|'set'} GoalType * @typedef {'none'|'all'|'newest'|'dict'|'set'} GoalType
@ -288,12 +288,12 @@ function initGoals(peer, config) {
// (Loop again with heavy computations now that it's inevitable:) // (Loop again with heavy computations now that it's inevitable:)
for (const [ tangle, min] of validTangles) { for (const [ tangle, min] of validTangles) {
const minMsgIDs = tangle const minMsgIDs = tangle
// @ts-ignore
.topoSort() .topoSort()
// @ts-ignore
.filter((msgID) => tangle.getDepth(msgID) === min) .filter((msgID) => tangle.getDepth(msgID) === min)
const deletablesErasables = tangle.getDeletablesAndErasables(...minMsgIDs) // @ts-ignore
// TODO: returning 'trail' to be on the safe side and not throw away too much. but i'm confused why the algo would've gotten this far but then this still manages to be null const { erasables } = tangle.getDeletablesAndErasables(...minMsgIDs)
if (!deletablesErasables) return ['trail']
const { erasables } = deletablesErasables
if (erasables.has(msgID)) return ['trail'] if (erasables.has(msgID)) return ['trail']
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "pzp-goals", "name": "pzp-goals",
"version": "1.0.1", "version": "1.0.0",
"description": "PZP tracker of replication goals", "description": "PZP tracker of replication goals",
"author": "Andre Staltz <contact@staltz.com>", "author": "Andre Staltz <contact@staltz.com>",
"license": "MIT", "license": "MIT",
@ -33,7 +33,7 @@
"bs58": "^5.0.0", "bs58": "^5.0.0",
"c8": "7", "c8": "7",
"pzp-caps": "^1.0.0", "pzp-caps": "^1.0.0",
"pzp-db": "^1.0.4", "pzp-db": "^1.0.1",
"pzp-dict": "^1.0.0", "pzp-dict": "^1.0.0",
"pzp-keypair": "^1.0.0", "pzp-keypair": "^1.0.0",
"pzp-set": "^1.0.0", "pzp-set": "^1.0.0",