From ec3f5cbfa05e6273cb7d1a408cf489cabca20e82 Mon Sep 17 00:00:00 2001 From: haad Date: Thu, 9 Mar 2023 08:38:47 +0200 Subject: [PATCH] Fix database address usage --- src/db/keyvalue-persisted.js | 2 +- test/orbitdb-open.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/keyvalue-persisted.js b/src/db/keyvalue-persisted.js index 8c627f9..10336a5 100644 --- a/src/db/keyvalue-persisted.js +++ b/src/db/keyvalue-persisted.js @@ -11,7 +11,7 @@ const KeyValuePersisted = async ({ OpLog, Database, ipfs, identity, address, nam const queue = new PQueue({ concurrency: 1 }) - directory = path.join(directory || './orbitdb', `./${address.path}/_index/`) + directory = path.join(directory || './orbitdb', `./${address}/_index/`) const index = await LevelStorage({ path: directory, valueEncoding }) let latestOplogHash diff --git a/test/orbitdb-open.test.js b/test/orbitdb-open.test.js index 9a1d342..9edeb35 100644 --- a/test/orbitdb-open.test.js +++ b/test/orbitdb-open.test.js @@ -134,7 +134,7 @@ describe('Open databases', function () { }) it('creates a directory for the database oplog', async () => { - const expectedPath = path.join(orbitdb1.directory, `./${db.address.path}`, '/log/_heads') + const expectedPath = path.join(orbitdb1.directory, `./${db.address}`, '/log/_heads') const directoryExists = fs.existsSync(expectedPath) strictEqual(directoryExists, true) })