Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: migration of link secret #1444

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
6 changes: 3 additions & 3 deletions packages/anoncreds/src/updates/0.3.1-0.4/linkSecret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export async function migrateLinkSecretToV0_4<Agent extends BaseAgent>(agent: Ag
const linkSecretRepository = agent.dependencyManager.resolve(AnonCredsLinkSecretRepository)

agent.config.logger.debug(`Fetching default link secret record from storage`)
const defaultLinkdSecret = await linkSecretRepository.findDefault(agent.context)
const defaultLinkSecret = await linkSecretRepository.findDefault(agent.context)

if (!defaultLinkdSecret) {
if (!defaultLinkSecret) {
// If no default link secret record exists, we create one based on the wallet id and set is as default
agent.config.logger.debug(`No default link secret record found. Creating one based on wallet id.`)

Expand All @@ -35,7 +35,7 @@ export async function migrateLinkSecretToV0_4<Agent extends BaseAgent>(agent: Ag
await linkSecretRepository.save(agent.context, linkSecret)
} else {
agent.config.logger.debug(
`Default link secret record with record id ${defaultLinkdSecret.id} and link secret id ${defaultLinkdSecret.linkSecretId} found. Skipping...`
`Default link secret record with record id ${defaultLinkSecret.id} and link secret id ${defaultLinkSecret.linkSecretId} found. Skipping...`
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export class IndySdkToAskarMigrationUpdater {
for (const row of masterSecrets) {
this.agent.config.logger.debug(`Migrating ${row.name} to the new askar format`)

const isDefault = masterSecrets.length === 0 ?? row.name === this.walletConfig.id
const isDefault = masterSecrets.length === 0 || row.name === this.walletConfig.id

const {
value: { ms },
Expand Down