Skip to content

Commit

Permalink
fix: migrate config failed
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Jun 18, 2024
1 parent 868b0c7 commit 9c8238e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pkg/migration/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -461,5 +461,5 @@ func Version14Upgrade(repoPath string) (err error) {
return
}

return repo.WriteVersion(repoPath, 14)
return repo.WriteVersion(repoPath, 13)
}
4 changes: 2 additions & 2 deletions pkg/repo/fsrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9c8238e

Please sign in to comment.