fix(identity-service): 修复手动重试钱包生成使用错误的事件类型

retryWalletGeneration 方法之前使用 createWalletGenerationEvent()
发布 UserAccountCreatedEvent,但 MPC 服务只监听 MpcKeygenRequestedEvent。

现在改为直接发布 MpcKeygenRequestedEvent,与 wallet-retry.task.ts 保持一致。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-27 10:15:30 -08:00
parent 9153ba3625
commit 339f95f7ed
1 changed files with 14 additions and 4 deletions

View File

@ -1878,12 +1878,22 @@ export class UserApplicationService {
}
}
// 4. 重新触发钱包生成流程
const event = account.createWalletGenerationEvent();
await this.eventPublisher.publish(event);
// 4. 重新触发钱包生成流程 - 使用 MpcKeygenRequestedEventMPC服务只监听此事件
const sessionId = crypto.randomUUID();
await this.eventPublisher.publish(
new MpcKeygenRequestedEvent({
sessionId,
userId: account.userId.toString(),
accountSequence: account.accountSequence.value,
username: `user_${account.accountSequence.value}`,
threshold: 2,
totalParties: 3,
requireDelegate: true,
}),
);
this.logger.log(
`[WALLET-RETRY] Wallet generation retry triggered for user: ${userId}`,
`[WALLET-RETRY] Wallet generation retry triggered for user: ${userId}, sessionId=${sessionId}`,
);
// 5. 更新 Redis 状态为 pending等待重新生成