feat(cli): add acc-address by id cli and grpc gateway api (#12199)
This commit is contained in:
+1066
-121
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,8 @@ type QueryClient interface {
|
||||
Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error)
|
||||
// Account returns account details based on address.
|
||||
Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error)
|
||||
// AccountAddressByID returns account address based on account id
|
||||
AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error)
|
||||
// Params queries all parameters.
|
||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
// ModuleAccounts returns all the existing module accounts.
|
||||
@@ -74,6 +76,15 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) {
|
||||
out := new(QueryAccountAddressByIDResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressByID", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||
out := new(QueryParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Params", in, out, opts...)
|
||||
@@ -129,6 +140,8 @@ type QueryServer interface {
|
||||
Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error)
|
||||
// Account returns account details based on address.
|
||||
Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error)
|
||||
// AccountAddressByID returns account address based on account id
|
||||
AccountAddressByID(context.Context, *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error)
|
||||
// Params queries all parameters.
|
||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||
// ModuleAccounts returns all the existing module accounts.
|
||||
@@ -160,6 +173,9 @@ func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest)
|
||||
func (UnimplementedQueryServer) Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Account not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) AccountAddressByID(context.Context, *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AccountAddressByID not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||
}
|
||||
@@ -224,6 +240,24 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_AccountAddressByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryAccountAddressByIDRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(QueryServer).AccountAddressByID(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressByID",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).AccountAddressByID(ctx, req.(*QueryAccountAddressByIDRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QueryParamsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -329,6 +363,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Account",
|
||||
Handler: _Query_Account_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AccountAddressByID",
|
||||
Handler: _Query_AccountAddressByID_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Params",
|
||||
Handler: _Query_Params_Handler,
|
||||
|
||||
Reference in New Issue
Block a user