-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(gov): migrate gov module to v8 (#735)
Co-authored-by: fx0x55 <80245546+fx0x55@users.noreply.github.com>
- Loading branch information
1 parent
8c2c51a
commit 09bceb4
Showing
5 changed files
with
70 additions
and
14 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
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,31 @@ | ||
package v8 | ||
|
||
import ( | ||
storetypes "cosmossdk.io/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
var ( | ||
// Deprecated: do not use, remove in v8 | ||
FxBaseParamsKeyPrefix = []byte("0x90") | ||
// Deprecated: do not use, remove in v8 | ||
FxEGFParamsKey = []byte("0x91") | ||
) | ||
|
||
func GetRemovedStoreKeys() [][]byte { | ||
return [][]byte{FxBaseParamsKeyPrefix, FxEGFParamsKey} | ||
} | ||
|
||
func DeleteOldParamsStore( | ||
ctx sdk.Context, | ||
storeKey storetypes.StoreKey, | ||
) { | ||
store := ctx.KVStore(storeKey) | ||
removeKeys := GetRemovedStoreKeys() | ||
for _, key := range removeKeys { | ||
iterator := storetypes.KVStorePrefixIterator(store, key) | ||
for ; iterator.Valid(); iterator.Next() { | ||
store.Delete(iterator.Key()) | ||
} | ||
} | ||
} |
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