Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rocksdb: rename flushedLength to signedLength #614

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class Hypercore extends EventEmitter {
return this.opened === false ? 0 : this.state.tree.length
}

get flushedLength () {
get signedLength () {
if (this.opened === false) return 0
if (this.state === this.core.state) return this.core.tree.length
const flushed = this.state.flushedLength()
Expand Down
4 changes: 2 additions & 2 deletions test/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ test('storage info, off by default', async function (t) {
test('indexedLength mirrors core length (linearised core compat)', async function (t) {
const core = await create(t)
t.is(core.length, 0)
t.is(core.flushedLength, core.length)
t.is(core.signedLength, core.length)

await core.append(['a', 'b'])
t.is(core.length, 2)
t.is(core.flushedLength, core.length)
t.is(core.signedLength, core.length)

await core.close()
})
Expand Down
8 changes: 4 additions & 4 deletions test/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ test('flush with bg activity persists non conflicting values', async function (t
t.alike(await clone.get(2, { wait: false }), b4a.from('c'))

t.is(b.byteLength, clone.byteLength)
t.is(b.flushedLength, b.length, 'nothing buffered')
t.is(b.signedLength, b.length, 'nothing buffered')

await b.close()
})
Expand Down Expand Up @@ -610,7 +610,7 @@ test('encryption and bigger batches', async function (t) {

// t.is(batch.length, 6)
// t.is(batch.byteLength, 6)
// t.is(batch.flushedLength, 3)
// t.is(batch.signedLength, 3)
// t.alike(await batch.seek(4), [4, 0])

// const clone = await create(t, core.key)
Expand Down Expand Up @@ -703,7 +703,7 @@ test('persistent batch', async function (t) {

t.is(batch.length, 6)
t.is(batch.byteLength, 6)
// t.is(batch.flushedLength, 3)
// t.is(batch.signedLength, 3)
// t.alike(await batch.seek(4), [4, 0])

await core.close()
Expand All @@ -716,7 +716,7 @@ test('persistent batch', async function (t) {

t.is(reopened.length, 6)
t.is(reopened.byteLength, 6)
// t.is(batch.flushedLength, 3)
// t.is(batch.signedLength, 3)
// t.alike(await batch.seek(4), [4, 0])

await reopened.close()
Expand Down
Loading