Skip to content

Commit

Permalink
close core instead
Browse files Browse the repository at this point in the history
  • Loading branch information
chm-diederichs committed Sep 5, 2024
1 parent 40f6a64 commit 6fd90a8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ test('create verifier - open existing core with manifest', async function (t) {
const key = Verifier.manifestHash(manifest)

const create = await createStored(t)
const core = await create(t, key, { compat: false })
const core = await create(key, { compat: false })
await core.ready()

t.is(core.manifest, null)
Expand All @@ -1452,12 +1452,12 @@ test('create verifier - open existing core with manifest', async function (t) {

manifest.signers[0].publicKey = b4a.alloc(32, 0)

const wrongCore = await create(t, null, { manifest, compat: false })
const wrongCore = await create(null, { manifest, compat: false })
await t.exception(wrongCore.ready(), /STORAGE_CONFLICT/)

manifest.signers[0].publicKey = keyPair.publicKey

const manifestCore = await create(t, null, { manifest, compat: false })
const manifestCore = await create(null, { manifest, compat: false })
await manifestCore.ready()

t.not(manifestCore.manifest, null)
Expand All @@ -1466,8 +1466,10 @@ test('create verifier - open existing core with manifest', async function (t) {

await manifestCore.close()

const compatCore = await create(t, null, { manifest, compat: true })
const compatCore = await create(null, { manifest, compat: true })
await t.execution(compatCore.ready()) // compat flag is unset internally

await compatCore.close()
})

function createMultiManifest (signers, prologue = null) {
Expand Down

0 comments on commit 6fd90a8

Please sign in to comment.