Skip to content

Commit

Permalink
add deprecated comment
Browse files Browse the repository at this point in the history
  • Loading branch information
insumity committed Sep 27, 2024
1 parent 85dc280 commit 9e9511d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions x/ccv/provider/keeper/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,22 +411,22 @@ func (k Keeper) AllocateTokensToConsumerValidators(

// consumer reward pools getter and setter

// GetConsumerRewardsAllocation returns the consumer rewards allocation for the given consumer id
// [DEPRECATED - See #2311] GetConsumerRewardsAllocation returns the consumer rewards allocation for the given consumer id
func (k Keeper) GetConsumerRewardsAllocation(ctx sdk.Context, consumerId string) (pool types.ConsumerRewardsAllocation) {
store := ctx.KVStore(k.storeKey)
b := store.Get(types.ConsumerRewardsAllocationKey(consumerId))
k.cdc.MustUnmarshal(b, &pool)
return
}

// SetConsumerRewardsAllocation sets the consumer rewards allocation for the given consumer id
// [DEPRECATED - See #2311] SetConsumerRewardsAllocation sets the consumer rewards allocation for the given consumer id
func (k Keeper) SetConsumerRewardsAllocation(ctx sdk.Context, consumerId string, pool types.ConsumerRewardsAllocation) {
store := ctx.KVStore(k.storeKey)
b := k.cdc.MustMarshal(&pool)
store.Set(types.ConsumerRewardsAllocationKey(consumerId), b)
}

// DeleteConsumerRewardsAllocation deletes the consumer rewards allocation for the given consumer id
// [DEPRECATED - See #2311] DeleteConsumerRewardsAllocation deletes the consumer rewards allocation for the given consumer id
func (k Keeper) DeleteConsumerRewardsAllocation(ctx sdk.Context, consumerId string) {
store := ctx.KVStore(k.storeKey)
store.Delete(types.ConsumerRewardsAllocationKey(consumerId))
Expand Down
5 changes: 3 additions & 2 deletions x/ccv/provider/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const (

DenylistKeyName = "DenylistKey"

// [DEPRECATED - See #2311]
ConsumerRewardsAllocationKeyName = "ConsumerRewardsAllocationKey"

ConsumerCommissionRateKeyName = "ConsumerCommissionRateKey"
Expand Down Expand Up @@ -329,7 +330,7 @@ func getKeyPrefixes() map[string]byte {
// denylisted.
DenylistKeyName: 37,

// ConsumerRewardsAllocationKey is the key for storing for each consumer the ICS rewards
// [DEPRECATED - See #2311] ConsumerRewardsAllocationKey is the key for storing for each consumer the ICS rewards
// allocated to the consumer rewards pool
ConsumerRewardsAllocationKeyName: 38,

Expand Down Expand Up @@ -606,7 +607,7 @@ func OptedInKey(consumerId string, providerAddr ProviderConsAddress) []byte {
return StringIdAndConsAddrKey(OptedInKeyPrefix(), consumerId, providerAddr.ToSdkConsAddr())
}

// ConsumerRewardsAllocationKey returns the key used to store the ICS rewards per consumer chain
// [DEPRECATED - See #2311]ConsumerRewardsAllocationKey returns the key used to store the ICS rewards per consumer chain
func ConsumerRewardsAllocationKey(consumerId string) []byte {
return append([]byte{mustGetKeyPrefix(ConsumerRewardsAllocationKeyName)}, []byte(consumerId)...)
}
Expand Down

0 comments on commit 9e9511d

Please sign in to comment.