From 1a2d73cf8dc792f73a6b4af175278da74cff3460 Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Fri, 26 May 2023 14:45:42 +0300 Subject: [PATCH] use feed.getId() in tests --- test/feed-sync.test.js | 6 +++--- test/thread-sync.test.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/feed-sync.test.js b/test/feed-sync.test.js index 6b18a09..5247fe2 100644 --- a/test/feed-sync.test.js +++ b/test/feed-sync.test.js @@ -64,7 +64,7 @@ test('sync a feed with goal=all', async (t) => { } t.pass('alice has msgs 1..10 from carol') - const carolPostsRootHash = alice.db.feed.getRoot(carolId, 'post') + const carolPostsRootHash = alice.db.feed.getId(carolId, 'post') const carolPostsRootMsg = alice.db.get(carolPostsRootHash) await p(bob.db.add)(carolPostsRootMsg, carolPostsRootHash) @@ -155,7 +155,7 @@ test('sync a feed with goal=newest', async (t) => { } t.pass('alice has msgs 1..10 from carol') - const carolPostsRootHash = alice.db.feed.getRoot(carolId, 'post') + const carolPostsRootHash = alice.db.feed.getId(carolId, 'post') const carolPostsRootMsg = alice.db.get(carolPostsRootHash) await p(bob.db.add)(carolPostsRootMsg, carolPostsRootHash) @@ -245,7 +245,7 @@ test('sync a feed with goal=newest but too far behind', async (t) => { carolMsgs.push(rec.msg) } - const carolPostsRootHash = alice.db.feed.getRoot(carolId, 'post') + const carolPostsRootHash = alice.db.feed.getId(carolId, 'post') const carolPostsRootMsg = alice.db.get(carolPostsRootHash) const algo = new Algorithm(alice) diff --git a/test/thread-sync.test.js b/test/thread-sync.test.js index 3e26a6a..503b8b8 100644 --- a/test/thread-sync.test.js +++ b/test/thread-sync.test.js @@ -114,7 +114,7 @@ test('sync a thread where both peers have portions', async (t) => { data: { text: 'A' }, keys: aliceKeys, }) - const rootHashA = alice.db.feed.getRoot(aliceId, 'post') + const rootHashA = alice.db.feed.getId(aliceId, 'post') const rootMsgA = alice.db.get(rootHashA) await p(bob.db.add)(rootMsgA, rootHashA) @@ -135,7 +135,7 @@ test('sync a thread where both peers have portions', async (t) => { tangles: [startA.hash], keys: bobKeys, }) - const rootHashB = bob.db.feed.getRoot(bobId, 'post') + const rootHashB = bob.db.feed.getId(bobId, 'post') const rootMsgB = bob.db.get(rootHashB) await p(alice.db.add)(rootMsgB, rootHashB)