Skip to content

Commit

Permalink
fix: errors and queries
Browse files Browse the repository at this point in the history
  • Loading branch information
shifty11 committed Oct 26, 2023
1 parent 85f7e52 commit b5ace00
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions x/funders/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ var (
ErrFundingDoesNotExist = errors.Register(ModuleName, 1105, "funding for pool %v and funder %v does not exist")
ErrFundingIsUsedUp = errors.Register(ModuleName, 1106, "funding for pool %v and funder %v is used up")

ErrFundingStateDoesNotExist = errors.Register(ModuleName, 1107, "funding state for pool %v does not exist")
ErrFundingStateAlreadyExists = errors.Register(ModuleName, 1108, "funding state for pool %v already exists")
ErrFundingStateDoesNotExist = errors.Register(ModuleName, 1107, "funding state for pool %v does not exist")
)
10 changes: 9 additions & 1 deletion x/query/keeper/grpc_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*t
globalParams := k.globalKeeper.GetParams(ctx)
govParams := k.govKeeper.GetParams(ctx)
sp := k.stakerKeeper.GetParams(ctx)
fp := k.fundersKeeper.GetParams(ctx)

return &types.QueryParamsResponse{BundlesParams: &bp, DelegationParams: &dp, GlobalParams: &globalParams, GovParams: &govParams, StakersParams: &sp}, nil
return &types.QueryParamsResponse{
BundlesParams: &bp,
DelegationParams: &dp,
GlobalParams: &globalParams,
GovParams: &govParams,
StakersParams: &sp,
FundersParams: &fp,
}, nil
}
3 changes: 1 addition & 2 deletions x/query/keeper/grpc_query_funders.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
fundersTypes "github.com/KYVENetwork/chain/x/funders/types"

sdk "github.com/cosmos/cosmos-sdk/types"
errorsTypes "github.com/cosmos/cosmos-sdk/types/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand Down Expand Up @@ -41,7 +40,7 @@ func (k Keeper) Funder(c context.Context, req *types.QueryFunderRequest) (*types

funder, found := k.fundersKeeper.GetFunder(ctx, req.Address)
if !found {
return nil, errorsTypes.ErrKeyNotFound
return nil, status.Error(codes.NotFound, "funder not found")
}

fundings := k.fundersKeeper.GetFundingsOfFunder(ctx, funder.Address)
Expand Down

0 comments on commit b5ace00

Please sign in to comment.