Skip to content

Commit

Permalink
CNS-1009: create new cache ctx in the query to make sure the query do…
Browse files Browse the repository at this point in the history
…esn't change the state
  • Loading branch information
oren-lava committed Oct 13, 2024
1 parent 8d597eb commit 3cd6061
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/subscription/keeper/grpc_query_estimated_rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func (k Keeper) EstimatedProviderRewards(goCtx context.Context, req *types.Query
if req == nil {
return nil, status.Error(codes.InvalidArgument, "invalid request")
}
ctx := sdk.UnwrapSDKContext(goCtx)
oldCtx := sdk.UnwrapSDKContext(goCtx)
ctx, _ := oldCtx.CacheContext() // verify the original ctx is not changed

res := types.QueryEstimatedRewardsResponse{}

details := []utils.Attribute{
Expand Down

0 comments on commit 3cd6061

Please sign in to comment.