Skip to content

Commit

Permalink
change key name for each module
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed Apr 17, 2024
1 parent 8f2f066 commit a87e104
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions x/marker/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
params = types.DefaultParams() // Assuming a method that returns default parameters

// Deserialize parameters if they are set
if bz := store.Get(types.ParamStoreKey); bz != nil {
if bz := store.Get(types.MarkerParamStoreKey); bz != nil {
k.cdc.MustUnmarshal(bz, &params)
}

Expand All @@ -26,7 +26,7 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshal(&params)
store.Set(types.ParamStoreKey, bz)
store.Set(types.MarkerParamStoreKey, bz)
}

// Deprecated: GetMaxTotalSupply is kept for backwards compatibility.
Expand Down
4 changes: 2 additions & 2 deletions x/marker/types/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ var (
// NetAssetValuePrefix prefix for net asset values of markers
NetAssetValuePrefix = []byte{0x04}

// ParamStoreKey key for marker module's params
ParamStoreKey = []byte{0x05}
// MarkerParamStoreKey key for marker module's params
MarkerParamStoreKey = []byte{0x05}
)

// MarkerAddress returns the module account address for the given denomination
Expand Down
4 changes: 2 additions & 2 deletions x/msgfees/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
store := ctx.KVStore(k.storeKey)
params = types.DefaultParams() // Initialize with defaults

bz := store.Get(types.ParamStoreKey)
bz := store.Get(types.MsgFeesParamStoreKey)
if bz != nil {
k.cdc.MustUnmarshal(bz, &params) // Deserialize parameters
}
Expand All @@ -22,7 +22,7 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshal(&params) // Serialize parameters
store.Set(types.ParamStoreKey, bz)
store.Set(types.MsgFeesParamStoreKey, bz)
}

// GetFloorGasPrice returns the current minimum gas price in sdk.Coin used in calculations for charging additional fees
Expand Down
4 changes: 2 additions & 2 deletions x/msgfees/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func GetMsgFeeKey(msgType string) []byte {
var (
//MsgFeeKeyPrefix prefix for msgfee entry
MsgFeeKeyPrefix = []byte{0x00}
// ParamStoreKey key for msgfees module's params
ParamStoreKey = []byte{0x01}
// MsgFeesParamStoreKey key for msgfees module's params
MsgFeesParamStoreKey = []byte{0x01}
)

func GetCompositeKey(msgType string, recipient string) string {
Expand Down
4 changes: 2 additions & 2 deletions x/name/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
store := ctx.KVStore(k.storeKey)
params = types.DefaultParams() // Assuming DefaultParams initializes all defaults

bz := store.Get(types.ParamStoreKey) // General key for all parameters
bz := store.Get(types.NameParamStoreKey) // General key for all parameters
if bz != nil {
k.cdc.MustUnmarshal(bz, &params) // Deserialize parameters from bytes
}
Expand All @@ -21,7 +21,7 @@ func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
store := ctx.KVStore(k.storeKey)
bz := k.cdc.MustMarshal(&params) // Serialize parameters to bytes
store.Set(types.ParamStoreKey, bz)
store.Set(types.NameParamStoreKey, bz)
}

// GetMaxNameLevels returns the current maximum number of name segments allowed.
Expand Down
4 changes: 2 additions & 2 deletions x/name/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ var (
NameKeyPrefix = []byte{0x03}
// AddressKeyPrefix is a prefix added to keys for indexing name records by address.
AddressKeyPrefix = []byte{0x05}
// ParamsStoreKey key for marker module's params
ParamStoreKey = []byte{0x06}
// NameParamStoreKey key for marker module's params
NameParamStoreKey = []byte{0x06}
)

// GetNameKeyPrefix converts a name into key format.
Expand Down

0 comments on commit a87e104

Please sign in to comment.