Skip to content

Commit

Permalink
chore: address review
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Apr 30, 2024
1 parent 462527a commit f244828
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions packages/filecoin-api/test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CID } from 'multiformats'
import { webcrypto } from 'one-webcrypto'
import { sha256 } from 'multiformats/hashes/sha2'
import * as raw from 'multiformats/codecs/raw'
import { Blob } from '@web-std/blob'

/** @param {number} size */
export async function randomBytes(size) {
Expand All @@ -24,8 +23,10 @@ export async function randomBlob(size) {
const hash = await sha256.digest(bytes)
const cid = CID.create(1, raw.code, hash)

const blob = new Blob([bytes])
return Object.assign(blob, { cid, bytes })
return {
cid,
bytes,
}
}

/**
Expand Down
6 changes: 4 additions & 2 deletions packages/filecoin-client/test/helpers/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ export async function randomBlob(size) {
const hash = await sha256.digest(bytes)
const cid = CID.create(1, raw.code, hash)

const blob = new Blob([bytes])
return Object.assign(blob, { cid, bytes })
return {
cid,
bytes,
}
}

/**
Expand Down

0 comments on commit f244828

Please sign in to comment.