-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ics29 counterparty address grpc query and CLI #1224
Changes from 4 commits
cefc65f
0347b36
67c36b8
60a745c
dec0152
8fe16d5
8babf8f
9561ade
0559e01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,3 +173,21 @@ func (k Keeper) TotalTimeoutFees(goCtx context.Context, req *types.QueryTotalTim | |
TimeoutFees: timeoutFees, | ||
}, nil | ||
} | ||
|
||
// CounterpartyAddress implements the Query/CounterpartyAddress gRPC method | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know the proto file describes what this gRPC endpoint does but I think it would be good to have an explanation here as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to open a doc issue for that separately? I think most if not all query handlers across the codebase use this godoc format. But I agree, we could keep this and add second line with a similar description to that in the proto files. I think that would be a good general improvement to all godocs for query handlers There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah good idea I'll open an issue for the other godoc comments but I think we can start by updating this one if we are in agreement :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
func (k Keeper) CounterpartyAddress(goCtx context.Context, req *types.QueryCounterpartyAddressRequest) (*types.QueryCounterpartyAddressResponse, error) { | ||
if req == nil { | ||
return nil, status.Error(codes.InvalidArgument, "empty request") | ||
} | ||
|
||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
|
||
counterpartyAddr, found := k.GetCounterpartyAddress(ctx, req.RelayerAddress, req.ChannelId) | ||
if !found { | ||
return nil, status.Errorf(codes.NotFound, "counterparty address not found for address: %s on channel: %s", req.RelayerAddress, req.ChannelId) | ||
} | ||
|
||
return &types.QueryCounterpartyAddressResponse{ | ||
CounterpartyAddress: counterpartyAddr, | ||
}, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that we currently have:
Should we choose one format that's closer to one of these?
Querying commands for IBC relayer incentivization
IBC relayer incentivization query subcommands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I like option 2! Will push an update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Updated both descriptions for queries and txs