feat: v1→v2 wallet key migration on server startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 10:45:06 +09:00
parent 3a75f64d44
commit 10a3f0156b
3 changed files with 62 additions and 0 deletions

View File

@@ -75,6 +75,11 @@ func main() {
}
chainHandler := chain.NewHandler(chainSvc)
// Migrate v1 wallets to v2 (HKDF per-wallet keys)
if err := chainSvc.MigrateWalletKeys(); err != nil {
log.Fatalf("wallet key migration failed: %v", err)
}
userResolver := func(username string) (uint, error) {
user, err := authRepo.FindByUsername(username)
if err != nil {