-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CNS-376: plans/projects to call fixation migration to version 2
This migration updates the refcount of head entries (i.e. entry versions that are most recent), as part of fixing the refcount and delete logic.
- Loading branch information
1 parent
2cdbedc
commit dea157d
Showing
4 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package keeper | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
type Migrator struct { | ||
keeper Keeper | ||
} | ||
|
||
func NewMigrator(keeper Keeper) Migrator { | ||
return Migrator{keeper: keeper} | ||
} | ||
|
||
// Migrate2to3 implements store migration from v2 to v3: | ||
// Trigger the version upgrade of the planFS fixation store | ||
func (m Migrator) Migrate2to3(ctx sdk.Context) error { | ||
keeper := m.keeper | ||
if err := keeper.plansFS.MigrateVersion(ctx); err != nil { | ||
return fmt.Errorf("%w: plans fixation-store", err) | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package keeper | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
type Migrator struct { | ||
keeper Keeper | ||
} | ||
|
||
func NewMigrator(keeper Keeper) Migrator { | ||
return Migrator{keeper: keeper} | ||
} | ||
|
||
// Migrate2to3 implements store migration from v2 to v3: | ||
// Trigger version upgrade of the projectsFS, develooperKeysFS fixation stores | ||
func (m Migrator) Migrate2to3(ctx sdk.Context) error { | ||
keeper := m.keeper | ||
if err := keeper.projectsFS.MigrateVersion(ctx); err != nil { | ||
return fmt.Errorf("%w: projects fixation-store", err) | ||
} | ||
if err := keeper.developerKeysFS.MigrateVersion(ctx); err != nil { | ||
return fmt.Errorf("%w: developerKeys fixation-store", err) | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters