When passed a corestore, Hyperdrive throws an error when destroyStorage() is called. This error doesn't happen when Hyperdrive is passed an instance of random-access-storage.
Code to reproduce error:
import Hyperdrive from 'hyperdrive'
import storage from 'random-access-memory'
import process from 'process'
import {
Client as HyperspaceClient,
Server as HyperspaceServer
} from 'hyperspace'
async function main () {
const server = new HyperspaceServer({ storage })
await server.ready()
const client = new HyperspaceClient()
await client.ready()
const drive = new Hyperdrive(client.corestore())
drive.on('error', err => {
console.error(err)
process.exit(1)
})
await drive.promises.ready()
await drive.promises.writeFile('/foo.svg', '<svg></svg>')
await drive.promises.close()
await drive.promises.destroyStorage()
console.log('success!')
await client.close()
await server.stop()
}
main().catch(err => console.error(err))
v10.20.0
When passed a corestore, Hyperdrive throws an error when
destroyStorage()
is called. This error doesn't happen when Hyperdrive is passed an instance ofrandom-access-storage
.Code to reproduce error: