Skip to content

Commit

Permalink
Add missing AccountLockedDuration method to grpc_query.go/
Browse files Browse the repository at this point in the history
  • Loading branch information
CmpHDL committed Apr 19, 2022
1 parent 7d43563 commit 4994c6f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions x/lockup/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ func (k Keeper) AccountLockedLongerDuration(goCtx context.Context, req *types.Ac
return &types.AccountLockedLongerDurationResponse{Locks: locks}, nil
}

// AccountLockedDuration Returns account locked with the duration specified
func (k Keeper) AccountLockedDuration(goCtx context.Context, req *types.AccountLockedDurationRequest) (*types.AccountLockedDurationResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
owner, err := sdk.AccAddressFromBech32(req.Owner)
if req.Owner == "" {
return nil, errors.New("empty address")
} else if err != nil {
return nil, err
}
locks := k.GetAccountLockedDuration(ctx, owner, req.Duration)
return &types.AccountLockedDurationResponse{Locks: locks}, nil
}

// AccountLockedLongerDurationDenom Returns account locked with duration longer than specified with specific denom
func (k Keeper) AccountLockedLongerDurationDenom(goCtx context.Context, req *types.AccountLockedLongerDurationDenomRequest) (*types.AccountLockedLongerDurationDenomResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
Expand Down

0 comments on commit 4994c6f

Please sign in to comment.