mirror of https://codeberg.org/pzp/pzp-goals.git
Compare commits
No commits in common. "master" and "v1.0.0" have entirely different histories.
10
lib/index.js
10
lib/index.js
|
@ -18,7 +18,7 @@ const p = (fn) => (...args) => {
|
|||
* @typedef {import('pzp-db').RecPresent} RecPresent
|
||||
* @typedef {import('pzp-db').Tangle} Tangle
|
||||
* @typedef {import('pzp-db').Msg} Msg
|
||||
* @typedef {import('pzp-db/db-tangle')} DBTangle
|
||||
* @typedef {NonNullable<ReturnType<PZPDB['getTangle']>>} DBTangle
|
||||
* @typedef {string} MsgID
|
||||
* @typedef {'none'|'all'|`newest-${number}`|'dict'|'set'} GoalDSL
|
||||
* @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:)
|
||||
for (const [ tangle, min] of validTangles) {
|
||||
const minMsgIDs = tangle
|
||||
// @ts-ignore
|
||||
.topoSort()
|
||||
// @ts-ignore
|
||||
.filter((msgID) => tangle.getDepth(msgID) === min)
|
||||
const deletablesErasables = tangle.getDeletablesAndErasables(...minMsgIDs)
|
||||
// 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
|
||||
if (!deletablesErasables) return ['trail']
|
||||
const { erasables } = deletablesErasables
|
||||
// @ts-ignore
|
||||
const { erasables } = tangle.getDeletablesAndErasables(...minMsgIDs)
|
||||
if (erasables.has(msgID)) return ['trail']
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "pzp-goals",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.0",
|
||||
"description": "PZP tracker of replication goals",
|
||||
"author": "Andre Staltz <contact@staltz.com>",
|
||||
"license": "MIT",
|
||||
|
@ -33,7 +33,7 @@
|
|||
"bs58": "^5.0.0",
|
||||
"c8": "7",
|
||||
"pzp-caps": "^1.0.0",
|
||||
"pzp-db": "^1.0.4",
|
||||
"pzp-db": "^1.0.1",
|
||||
"pzp-dict": "^1.0.0",
|
||||
"pzp-keypair": "^1.0.0",
|
||||
"pzp-set": "^1.0.0",
|
||||
|
|
Loading…
Reference in New Issue