Skip to content

Commit

Permalink
fix: use digest as location claim content
Browse files Browse the repository at this point in the history
  • Loading branch information
joaosa committed Jun 4, 2024
1 parent 178f37b commit 2646955
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
4 changes: 1 addition & 3 deletions packages/upload-api/src/blob/accept.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as Link from 'multiformats/link'
import { code as rawCode } from 'multiformats/codecs/raw'
import * as Server from '@ucanto/server'
import * as DID from '@ipld/dag-ucan/did'
import * as W3sBlob from '@web3-storage/capabilities/web3.storage/blob'
Expand Down Expand Up @@ -52,7 +50,7 @@ export function blobAcceptProvider(context) {
audience: DID.parse(space),
with: context.id.toDIDKey(),
nb: {
content: Link.create(rawCode, digest),
content: { digest: digest.bytes },
location: [createUrl.ok],
},
expiration: Infinity,
Expand Down
7 changes: 0 additions & 7 deletions packages/upload-api/test/handlers/web3.storage.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import * as API from '../../src/types.js'
import { equals } from 'uint8arrays'
import { create as createLink } from 'multiformats/link'
import { Absentee } from '@ucanto/principal'
import { Digest } from 'multiformats/hashes/digest'
import { sha256 } from 'multiformats/hashes/sha2'
import { code as rawCode } from 'multiformats/codecs/raw'
import { Assert } from '@web3-storage/content-claims/capability'
import * as BlobCapabilities from '@web3-storage/capabilities/blob'
import * as W3sBlobCapabilities from '@web3-storage/capabilities/web3.storage/blob'
Expand Down Expand Up @@ -604,10 +601,6 @@ export const test = {
const multihash = await sha256.digest(data)
const digest = multihash.bytes
const size = data.byteLength
const content = createLink(
rawCode,
new Digest(sha256.code, 32, digest, digest)
)

// create service connection
const connection = connect({
Expand Down

0 comments on commit 2646955

Please sign in to comment.