Skip to content

Commit

Permalink
refactor: simplify claim keys & claims query pagination filter
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Sep 26, 2023
1 parent a9c5fc3 commit 6516f68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion x/servicer/keeper/claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (k Keeper) InsertClaim(ctx sdk.Context, claim *types.MsgClaim) error {
return err
}

claimKey := fmt.Sprintf("%s/%s", claim.ServicerAddress, claim.SmstRootHash)
claimKey := fmt.Sprintf("%s", claim.SessionId)
store.Set([]byte(claimKey), claimBz)
return nil
}
4 changes: 1 addition & 3 deletions x/servicer/keeper/query_claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package keeper

import (
"context"
"strings"

"github.com/cosmos/cosmos-sdk/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
Expand All @@ -29,7 +27,7 @@ func (k Keeper) Claims(goCtx context.Context, req *types.QueryClaimsRequest) (*t
return false, err
}

if strings.HasPrefix(string(key), req.ServicerAddress) {
if claim.ServicerAddress == req.ServicerAddress {
if accumulate {
claims = append(claims, claim)
}
Expand Down

0 comments on commit 6516f68

Please sign in to comment.