Skip to content

Commit f235121

Browse files
committed
packages/signer-atp: upgrade dep
1 parent cf86677 commit f235121

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/signer-atp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@canvas-js/interfaces": "0.15.0-next.3",
2020
"@canvas-js/signatures": "0.15.0-next.3",
2121
"@canvas-js/utils": "1.0.0",
22-
"@ipld/car": "^5.4.0",
22+
"@ipld/car": "^5.4.2",
2323
"@ipld/dag-cbor": "^9.2.2",
2424
"@ipld/dag-json": "^10.2.3",
2525
"@libp2p/logger": "^5.1.13",

packages/signer-atp/src/mst.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type Entry = { p: number; k: Uint8Array; v?: CID; t?: CID }
1010

1111
async function unpackNode<T>(car: CarReader, path: string, cid: CID, decoder = new TextDecoder()): Promise<T> {
1212
const block = await car.get(cid)
13+
assert(block !== undefined, "invalid block")
1314
const { l, e } = cbor.decode<Node>(block.bytes)
1415

1516
let node = l
@@ -22,6 +23,7 @@ async function unpackNode<T>(car: CarReader, path: string, cid: CID, decoder = n
2223
} else if (needle === path) {
2324
assert(v !== undefined, "failed to parse record")
2425
const block = await car.get(v)
26+
assert(block !== undefined, "invalid block")
2527
return cbor.decode<T>(block.bytes)
2628
} else {
2729
break
@@ -38,6 +40,7 @@ export async function unpackArchive<T extends { $type: string }>(
3840
const car = await CarReader.fromBytes(archive)
3941
const [root] = await car.getRoots()
4042
const block = await car.get(root)
43+
assert(block !== undefined, "invalid block")
4144
const commit = cbor.decode<Commit>(block.bytes)
4245

4346
const record = await unpackNode<T>(car, path, commit.data)

0 commit comments

Comments
 (0)