From 9c8238e844c5096b2c20c5bf8437c0f632109d90 Mon Sep 17 00:00:00 2001 From: simlecode <69969590+simlecode@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:33:30 +0800 Subject: [PATCH] fix: migrate config failed --- pkg/migration/migrate.go | 8 ++++---- pkg/repo/fsrepo.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/migration/migrate.go b/pkg/migration/migrate.go index 76ce6da14b..6d499ab324 100644 --- a/pkg/migration/migrate.go +++ b/pkg/migration/migrate.go @@ -35,7 +35,7 @@ var versionMap = []versionInfo{ {version: 10, upgrade: Version10Upgrade}, {version: 11, upgrade: Version11Upgrade}, {version: 12, upgrade: Version12Upgrade}, - {version: 14, upgrade: Version14Upgrade}, + {version: 13, upgrade: Version13Upgrade}, } // TryToMigrate used to migrate data(db,config,file,etc) in local repo @@ -438,8 +438,8 @@ func Version12Upgrade(repoPath string) (err error) { return repo.WriteVersion(repoPath, 12) } -// Version14Upgrade will modify mainnet bootstrap -func Version14Upgrade(repoPath string) (err error) { +// Version13Upgrade will modify mainnet bootstrap +func Version13Upgrade(repoPath string) (err error) { var fsrRepo repo.Repo if fsrRepo, err = repo.OpenFSRepo(repoPath, 12); err != nil { return @@ -461,5 +461,5 @@ func Version14Upgrade(repoPath string) (err error) { return } - return repo.WriteVersion(repoPath, 14) + return repo.WriteVersion(repoPath, 13) } diff --git a/pkg/repo/fsrepo.go b/pkg/repo/fsrepo.go index 10df5fa6d2..cd31a2846c 100644 --- a/pkg/repo/fsrepo.go +++ b/pkg/repo/fsrepo.go @@ -24,7 +24,7 @@ import ( ) // Version is the version of repo schema that this code understands. -const LatestVersion uint = 14 +const LatestVersion uint = 13 const ( // apiFile is the filename containing the filecoin node's api address. @@ -203,7 +203,7 @@ func (r *FSRepo) loadFromDisk() error { } if localVersion > r.version { - return fmt.Errorf("binary needs update to handle repo version, got %d expected %d. Update binary to latest release", localVersion, LatestVersion) + return fmt.Errorf("binary needs update to handle repo version, got %d expected %d. Update binary to latest release", localVersion, r.version) } if err := r.loadConfig(); err != nil {