-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x{stake,slash,gov,distrib} In-place Store Migrations #8504
Changes from 58 commits
10d72d7
8036fca
a9a406e
9ed3987
a095d3a
d550bff
b7141f9
2d554ce
3df3f44
ba6bd44
197b7ce
424932c
254a71f
b6c0714
9ab7f13
fc076f5
ae7b7dc
2c26734
eb15047
291a9e6
41d29ed
33494dc
e3a2412
6db31d4
55f547e
8f3b9d4
29b85b7
41e0339
d922003
f422b93
8cf88fe
5add13a
74b761a
2816a20
f18f253
9e5999e
b15f03d
236e46c
a52441e
b403770
9546583
33d4e70
9e5d611
518b878
9b625b0
2392629
c734484
9c11560
b0a665e
0e24bad
4942857
30d9045
828a41b
f3ca3e5
0e17848
95f524f
5456591
b5ff927
036bd30
21e8a15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package keeper | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
v042 "github.com/cosmos/cosmos-sdk/x/distribution/legacy/v042" | ||
) | ||
|
||
// Migrator is a struct for handling in-place store migrations. | ||
type Migrator struct { | ||
keeper Keeper | ||
} | ||
amaury1093 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// NewMigrator returns a new Migrator. | ||
func NewMigrator(keeper Keeper) Migrator { | ||
return Migrator{keeper: keeper} | ||
} | ||
|
||
// Migrate1 migrates from version 1 to 2. | ||
func (m Migrator) Migrate1(ctx sdk.Context) error { | ||
return v042.MigrateStore(ctx, m.keeper.storeKey) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of enlarging the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other idea is just to make this functions directly:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This would be ideal, but we can't access private OK for the Migrator way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about naming this as
Migrate1to2
?