Skip to content

Commit 2b8d2d1

Browse files
authored
Get undefined block is not allowed (#482)
* Geting undefined block should not corrupt * Basic test
1 parent 6558a1f commit 2b8d2d1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/basic.js

+13
Original file line numberDiff line numberDiff line change
@@ -428,3 +428,16 @@ test('append above the max suggested block size', async function (t) {
428428
t.pass('should throw')
429429
}
430430
})
431+
432+
test('get undefined block is not allowed', async function (t) {
433+
t.plan(1)
434+
435+
const core = new Hypercore(RAM)
436+
437+
try {
438+
await core.get(undefined)
439+
t.fail()
440+
} catch (err) {
441+
t.pass(err.code, 'ERR_ASSERTION')
442+
}
443+
})

0 commit comments

Comments
 (0)