mirror of https://codeberg.org/pzp/pzp-db.git
rename a Tangle method
This commit is contained in:
parent
0d166644c3
commit
fd7b76808b
|
@ -185,7 +185,7 @@ class Tangle {
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
getDeletablesAndEmptyables(msgHash) {
|
getDeletablesAndErasables(msgHash) {
|
||||||
const emptyables = this.#shortestPathToRoot(msgHash)
|
const emptyables = this.#shortestPathToRoot(msgHash)
|
||||||
const sorted = this.topoSort()
|
const sorted = this.topoSort()
|
||||||
const index = sorted.indexOf(msgHash)
|
const index = sorted.indexOf(msgHash)
|
||||||
|
|
|
@ -161,18 +161,18 @@ test('Tangle.getLipmaaSet', (t) => {
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Tangle.getDeletablesAndEmptyables basic', (t) => {
|
test('Tangle.getDeletablesAndErasables basic', (t) => {
|
||||||
const tangle = new Tangle(rootPost, peer.db.records())
|
const tangle = new Tangle(rootPost, peer.db.records())
|
||||||
const { deletables, emptyables } = tangle.getDeletablesAndEmptyables(reply2A)
|
const { deletables, emptyables } = tangle.getDeletablesAndErasables(reply2A)
|
||||||
|
|
||||||
t.deepEquals(deletables, [reply1Hi], 'deletables')
|
t.deepEquals(deletables, [reply1Hi], 'deletables')
|
||||||
t.deepEquals(emptyables, [reply1Lo, rootPost], 'emptyables')
|
t.deepEquals(emptyables, [reply1Lo, rootPost], 'emptyables')
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Tangle.getDeletablesAndEmptyables with lipmaa', (t) => {
|
test('Tangle.getDeletablesAndErasables with lipmaa', (t) => {
|
||||||
const tangle = new Tangle(rootPost, peer.db.records())
|
const tangle = new Tangle(rootPost, peer.db.records())
|
||||||
const { deletables, emptyables } = tangle.getDeletablesAndEmptyables(reply3Lo)
|
const { deletables, emptyables } = tangle.getDeletablesAndErasables(reply3Lo)
|
||||||
|
|
||||||
t.deepEquals(deletables, [reply1Lo, reply1Hi, reply2A], 'deletables')
|
t.deepEquals(deletables, [reply1Lo, reply1Hi, reply2A], 'deletables')
|
||||||
t.deepEquals(emptyables, [rootPost], 'emptyables')
|
t.deepEquals(emptyables, [rootPost], 'emptyables')
|
||||||
|
|
Loading…
Reference in New Issue