Skip to content

Commit

Permalink
fix: migration
Browse files Browse the repository at this point in the history
  • Loading branch information
auer-martin committed Jan 4, 2024
1 parent 3d9b842 commit c7d9ba7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('W3cCredentialRecord', () => {
proofTypes: credential.proofTypes,
givenId: credential.id,
expandedTypes: ['https://expanded.tag#1'],
types: ['VerifiableCredential', 'UniversityDegreeCredential'],
})
})
})
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/storage/migration/updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { updateV0_1ToV0_2 } from './updates/0.1-0.2'
import { updateV0_2ToV0_3 } from './updates/0.2-0.3'
import { updateV0_3ToV0_3_1 } from './updates/0.3-0.3.1'
import { updateV0_3_1ToV0_4 } from './updates/0.3.1-0.4'
import { updateV0_4ToV0_5 } from './updates/0.4-0.5'

export const INITIAL_STORAGE_VERSION = '0.1'

Expand Down Expand Up @@ -46,6 +47,11 @@ export const supportedUpdates = [
toVersion: '0.4',
doUpdate: updateV0_3_1ToV0_4,
},
{
fromVersion: '0.3.1',
toVersion: '0.4',
doUpdate: updateV0_4ToV0_5,
},
] as const

// Current version is last toVersion from the supported updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('0.4-0.5 | W3cCredentialRecord', () => {
expect(repository.update).toHaveBeenCalledTimes(1)

const [, record] = mockFunction(repository.update).mock.calls[0]
expect(record.getTags().claimFormat).toEqual('ldp_vc')
expect(record.getTags().types).toEqual(['VerifiableCredential', 'UniversityDegreeCredential'])
})
})
})

0 comments on commit c7d9ba7

Please sign in to comment.