Skip to content

Commit

Permalink
fix: upgrade to latest content-claims
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw committed May 29, 2024
1 parent 5fb3dbb commit d78221e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 31 deletions.
42 changes: 14 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"@ipld/dag-cbor": "^9.0.8",
"@ipld/dag-json": "^10.1.7",
"@ipld/dag-pb": "^4.0.8",
"@web3-storage/blob-fetcher": "^2.1.2",
"@web3-storage/content-claims": "^4.0.5",
"@web3-storage/blob-fetcher": "^2.1.3",
"@web3-storage/gateway-lib": "^5.0.1",
"cardex": "^3.0.0",
"dagula": "^7.3.0",
Expand All @@ -54,6 +53,7 @@
"@aws-sdk/client-s3": "^3.490.0",
"@cloudflare/workers-types": "^4.20231218.0",
"@ucanto/principal": "^8.1.0",
"@web3-storage/content-claims": "^5.0.0",
"@web3-storage/public-bucket": "^1.0.0",
"ava": "^5.3.1",
"carbites": "^1.0.6",
Expand Down
5 changes: 4 additions & 1 deletion test/helpers/content-claims.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import http from 'node:http'
import { Writable } from 'node:stream'
import { CARReaderStream, CARWriterStream } from 'carstream'
import { sha256 } from 'multiformats/hashes/sha2'
import { base58btc } from 'multiformats/bases/base58'
import * as Digest from 'multiformats/hashes/digest'
import * as Link from 'multiformats/link'
import * as raw from 'multiformats/codecs/raw'
import { Map as LinkMap } from 'lnmap'
import { Assert } from '@web3-storage/content-claims/capability'
import * as ed25519 from '@ucanto/principal/ed25519'
Expand Down Expand Up @@ -92,7 +95,7 @@ export const mockClaimsService = async () => {

const server = http.createServer(async (req, res) => {
callCount++
const content = Link.parse(String(req.url?.split('/')[2]))
const content = Link.create(raw.code, Digest.decode(base58btc.decode(String(req.url?.split('/')[3]))))
const blocks = [...claims.get(content) ?? []]
const readable = new ReadableStream({
pull (controller) {
Expand Down

0 comments on commit d78221e

Please sign in to comment.