Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/synapse-core/src/utils/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export interface MetadataDataSetInternal {
}

export interface MetadataPieceInternal {
ipni?: boolean
ipfsRootCID?: string
}
/**
Expand Down Expand Up @@ -89,7 +88,6 @@ export function pieceMetadataObjectToEntry(
): MetadataEntry[] {
const obj = {
...(metadataObject ?? {}),
...(metadataInternal?.ipni ? { withIPNI: '' } : {}),
...(metadataInternal?.ipfsRootCID ? { ipfsRootCID: metadataInternal.ipfsRootCID } : {}),
}
const entries = Object.entries(obj)
Expand Down
19 changes: 0 additions & 19 deletions packages/synapse-core/test/metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,6 @@ describe('Metadata Utils', () => {
assert.deepEqual(result, [])
})

it('should add withIPNI when ipni internal flag is true', () => {
const result = pieceMetadataObjectToEntry({ key: 'value' }, { ipni: true })

assert.deepEqual(result, [
{ key: 'key', value: 'value' },
{ key: 'withIPNI', value: '' },
])
})

it('should add ipfsRootCID when provided', () => {
const cid = 'bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi'
const result = pieceMetadataObjectToEntry({ key: 'value' }, { ipfsRootCID: cid })
Expand All @@ -191,16 +182,6 @@ describe('Metadata Utils', () => {
])
})

it('should add both ipni and ipfsRootCID when both provided', () => {
const cid = 'bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi'
const result = pieceMetadataObjectToEntry({}, { ipni: true, ipfsRootCID: cid })

assert.deepEqual(result, [
{ key: 'ipfsRootCID', value: cid },
{ key: 'withIPNI', value: '' },
])
})

it('should throw when exceeding max keys per piece', () => {
const tooManyKeys: Record<string, string> = {}
for (let i = 0; i < METADATA_LIMITS.MAX_KEYS_PER_PIECE + 1; i++) {
Expand Down
Loading