Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit ef95579

Browse files
committed
fix: make recursive pins depth infinity
1 parent d33b615 commit ef95579

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

migrations/migration-9/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ async function pinsToDatastore (blockstore, datastore, pinstore) {
1616
const pinRoot = dagpb.util.deserialize(pinRootBuf)
1717

1818
for await (const cid of pinset.loadSet(blockstore, pinRoot, PinTypes.recursive)) {
19-
const pin = {}
19+
const pin = {
20+
depth: Infinity
21+
}
2022

2123
if (cid.version !== 0) {
2224
pin.version = version

test/migrations/migration-9-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ module.exports = (setup, cleanup, options) => {
120120
expect(keyToCid(key).toString()).to.equal(pinnedCid.toString())
121121

122122
const pin = cbor.decode(pins[0].value)
123-
expect(pin.depth).to.be.undefined()
123+
expect(pin.depth).to.equal(Infinity)
124124

125125
await datastore.open()
126126
await expect(datastore.has(PIN_DS_KEY)).to.eventually.be.false()

0 commit comments

Comments
 (0)