diff --git a/backend/services/identity-service/src/application/services/user-application.service.ts b/backend/services/identity-service/src/application/services/user-application.service.ts index 88829233..cbd19a4c 100644 --- a/backend/services/identity-service/src/application/services/user-application.service.ts +++ b/backend/services/identity-service/src/application/services/user-application.service.ts @@ -1878,12 +1878,22 @@ export class UserApplicationService { } } - // 4. 重新触发钱包生成流程 - const event = account.createWalletGenerationEvent(); - await this.eventPublisher.publish(event); + // 4. 重新触发钱包生成流程 - 使用 MpcKeygenRequestedEvent(MPC服务只监听此事件) + 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(等待重新生成)