From 339f95f7edd0a87e1c202dfbf8b35545b1fea938 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 27 Dec 2025 10:15:30 -0800 Subject: [PATCH] =?UTF-8?q?fix(identity-service):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=89=8B=E5=8A=A8=E9=87=8D=E8=AF=95=E9=92=B1=E5=8C=85=E7=94=9F?= =?UTF-8?q?=E6=88=90=E4=BD=BF=E7=94=A8=E9=94=99=E8=AF=AF=E7=9A=84=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../services/user-application.service.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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(等待重新生成)