refactor: use new CID with the multihash
This commit is contained in:
parent
f7a760051f
commit
0c304b20db
|
@ -76,14 +76,15 @@ export const fileProvider: SdkProvider = {
|
||||||
const manifest = await getIsManifest(s5, pin.hash) as number;
|
const manifest = await getIsManifest(s5, pin.hash) as number;
|
||||||
|
|
||||||
if (manifest) {
|
if (manifest) {
|
||||||
|
const mHash = Multihash.fromBase64Url(pin.hash);
|
||||||
items.push({
|
items.push({
|
||||||
cid: CID.fromHash(pin.hash, pin.size, manifest).toString(),
|
cid: new CID(manifest, mHash, pin.size).toString(),
|
||||||
type: "manifest",
|
type: "manifest",
|
||||||
mimeType: "application/octet-stream",
|
mimeType: "application/octet-stream",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
items.push({
|
items.push({
|
||||||
cid: CID.fromHash(pin.hash, pin.size, CID_TYPES.RAW).toString(),
|
cid: new CID(CID_TYPES.RAW, Multihash.fromBase64Url(pin.hash), pin.size).toString(),
|
||||||
type: "raw",
|
type: "raw",
|
||||||
mimeType: pin.mime_type,
|
mimeType: pin.mime_type,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue