add tangle.id field

This commit is contained in:
Andre Staltz 2023-10-19 13:37:57 +03:00
parent d74695b7e7
commit 748125b6e6
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
2 changed files with 5 additions and 0 deletions

View File

@ -196,6 +196,10 @@ class Tangle {
return isMoot(this.#rootMsg)
}
get id() {
return this.#rootID
}
get mootDetails() {
if (!this.#isFeed()) return null
if (!this.#rootMsg) {

View File

@ -16,6 +16,7 @@ test('simple multi-author tangle', (t) => {
const mootA = MsgV3.createMoot(accountA, 'post', keypairA)
const mootAID = MsgV3.getMsgID(mootA)
const tangleA = new MsgV3.Tangle(mootAID)
assert.equal(tangleA.id, mootAID, 'tangle.id')
tangleA.add(mootAID, mootA)
const mootB = MsgV3.createMoot(accountB, 'post', keypairB)