Skip to content

Commit

Permalink
feat(envited.ascs.digital): add groups to ipfs uploads
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Scheeren <[email protected]>
  • Loading branch information
royscheeren committed Dec 3, 2024
1 parent bba2d8a commit c06302d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { create } from 'domain'

import * as SUT from './processAssetUpload'

describe('common/aws/handlers/processAssetUpload', () => {
Expand Down Expand Up @@ -167,7 +168,6 @@ describe('common/aws/handlers/processAssetUpload', () => {
expect(copyFileStub).toHaveBeenCalledTimes(0)
expect(createGroupStub).toHaveBeenCalledTimes(0)
expect(uploadFileStub).toHaveBeenCalledTimes(0)

})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ValidationReport from 'rdf-validate-shacl/src/validation-report'
import { getAsset, updateAsset, validateAndCreateMetadata } from '../../../asset'
import { ExtractedFileWithCID, ManifestExtractedFiles } from '../../../asset/types'
import { copyFile, deleteFile, readFile, writeFile } from '../../../aws'
import { uploadFile, createGroup } from '../../../ipfs'
import { createGroup, uploadFile } from '../../../ipfs'
import { Asset, AssetMetadata, AssetStatus } from '../../../types'

export const _main =
Expand Down Expand Up @@ -56,7 +56,7 @@ export const _main =
status: AssetStatus,
metadata?: AssetMetadata | string,
manifest?: Record<string, unknown>,
) => Promise<Asset>,
) => Promise<Asset>
uploadFile: ({
arrayBuffer,
filename,
Expand Down Expand Up @@ -141,7 +141,7 @@ export const _main =
async ({ path, arrayBuffer }: { path: string; arrayBuffer: ArrayBuffer }) => {
const group = await createGroup(metadata.minter)
return uploadFile({ arrayBuffer, filename: last(split('/', path)) as string, group })
}
},
)

Promise.all(pinataIpfsPromises)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const uploadTokenMetadataToIPFS =
}

const group = await createGroup(user.issuerId)
return uploadJson({ data: (asset as Asset).metadata , filename: 'token_info.json', group })
return uploadJson({ data: (asset as Asset).metadata, filename: 'token_info.json', group })
}

export const uploadTokenMetadata = uploadTokenMetadataToIPFS({
Expand Down

0 comments on commit c06302d

Please sign in to comment.