Skip to content

Commit

Permalink
fixed key duplication on token staking participant
Browse files Browse the repository at this point in the history
  • Loading branch information
faneaatiku committed Apr 18, 2024
1 parent 26e283b commit 5404194
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x/rewards/keeper/msg_server_exit_staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (k msgServer) beginUnlock(ctx sdk.Context, p types.StakingRewardParticipant
lockedUntil := k.epochKeeper.GetEpochCountByIdentifier(ctx, expirationEpoch)
lockedUntil += int64(sr.Lock) * 24
pending := types.PendingUnlockParticipant{
Index: types.CreatePendingUnlockParticipantKey(lockedUntil, sr.RewardId),
Index: types.CreatePendingUnlockParticipantKey(lockedUntil, fmt.Sprintf("%s/%s", sr.RewardId, p.Address)),
Address: p.Address,
Amount: p.Amount,
Denom: sr.StakingDenom,
Expand Down
2 changes: 1 addition & 1 deletion x/rewards/types/key_pending_unlock_participant.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func PendingUnlockParticipantKey(key string) []byte {
}

func CreatePendingUnlockParticipantKey(epoch int64, key string) string {
return fmt.Sprintf("%d/%s/", epoch, key)
return fmt.Sprintf("%d/%s", epoch, key)
}

// PendingUnlockParticipantPrefix returns the store key to retrieve all PendingUnlockParticipant for an epoch
Expand Down

0 comments on commit 5404194

Please sign in to comment.