From ae3e1907fa8fd89ae505d47f18867fa8e408d14e Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 24 Jan 2023 12:30:12 -0500 Subject: [PATCH 01/24] updates --- api/cosmos/staking/v1beta1/tx.pulsar.go | 2 +- api/cosmos/tx/v1beta1/service.pulsar.go | 495 ++++++++++++++---------- proto/cosmos/tx/v1beta1/service.proto | 32 +- types/tx/service.pb.go | 224 +++++++---- x/auth/tx/query.go | 51 --- x/auth/tx/service.go | 44 ++- x/staking/types/tx.pb.go | 2 +- 7 files changed, 479 insertions(+), 371 deletions(-) diff --git a/api/cosmos/staking/v1beta1/tx.pulsar.go b/api/cosmos/staking/v1beta1/tx.pulsar.go index c9948953c00c..81789ad31a9c 100644 --- a/api/cosmos/staking/v1beta1/tx.pulsar.go +++ b/api/cosmos/staking/v1beta1/tx.pulsar.go @@ -7559,7 +7559,7 @@ type MsgUndelegateResponse struct { unknownFields protoimpl.UnknownFields CompletionTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=completion_time,json=completionTime,proto3" json:"completion_time,omitempty"` - // amount returns the amount undelegated coins + // amount returns the amount of undelegated coins // // Since: cosmos-sdk 0.48 Amount *v1beta1.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` diff --git a/api/cosmos/tx/v1beta1/service.pulsar.go b/api/cosmos/tx/v1beta1/service.pulsar.go index 5722e70aaa73..0a5e51f8e3d5 100644 --- a/api/cosmos/tx/v1beta1/service.pulsar.go +++ b/api/cosmos/tx/v1beta1/service.pulsar.go @@ -69,6 +69,7 @@ var ( fd_GetTxsEventRequest_order_by protoreflect.FieldDescriptor fd_GetTxsEventRequest_page protoreflect.FieldDescriptor fd_GetTxsEventRequest_limit protoreflect.FieldDescriptor + fd_GetTxsEventRequest_query protoreflect.FieldDescriptor ) func init() { @@ -79,6 +80,7 @@ func init() { fd_GetTxsEventRequest_order_by = md_GetTxsEventRequest.Fields().ByName("order_by") fd_GetTxsEventRequest_page = md_GetTxsEventRequest.Fields().ByName("page") fd_GetTxsEventRequest_limit = md_GetTxsEventRequest.Fields().ByName("limit") + fd_GetTxsEventRequest_query = md_GetTxsEventRequest.Fields().ByName("query") } var _ protoreflect.Message = (*fastReflection_GetTxsEventRequest)(nil) @@ -176,6 +178,12 @@ func (x *fastReflection_GetTxsEventRequest) Range(f func(protoreflect.FieldDescr return } } + if x.Query != "" { + value := protoreflect.ValueOfString(x.Query) + if !f(fd_GetTxsEventRequest_query, value) { + return + } + } } // Has reports whether a field is populated. @@ -201,6 +209,8 @@ func (x *fastReflection_GetTxsEventRequest) Has(fd protoreflect.FieldDescriptor) return x.Page != uint64(0) case "cosmos.tx.v1beta1.GetTxsEventRequest.limit": return x.Limit != uint64(0) + case "cosmos.tx.v1beta1.GetTxsEventRequest.query": + return x.Query != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.tx.v1beta1.GetTxsEventRequest")) @@ -227,6 +237,8 @@ func (x *fastReflection_GetTxsEventRequest) Clear(fd protoreflect.FieldDescripto x.Page = uint64(0) case "cosmos.tx.v1beta1.GetTxsEventRequest.limit": x.Limit = uint64(0) + case "cosmos.tx.v1beta1.GetTxsEventRequest.query": + x.Query = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.tx.v1beta1.GetTxsEventRequest")) @@ -261,6 +273,9 @@ func (x *fastReflection_GetTxsEventRequest) Get(descriptor protoreflect.FieldDes case "cosmos.tx.v1beta1.GetTxsEventRequest.limit": value := x.Limit return protoreflect.ValueOfUint64(value) + case "cosmos.tx.v1beta1.GetTxsEventRequest.query": + value := x.Query + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.tx.v1beta1.GetTxsEventRequest")) @@ -293,6 +308,8 @@ func (x *fastReflection_GetTxsEventRequest) Set(fd protoreflect.FieldDescriptor, x.Page = value.Uint() case "cosmos.tx.v1beta1.GetTxsEventRequest.limit": x.Limit = value.Uint() + case "cosmos.tx.v1beta1.GetTxsEventRequest.query": + x.Query = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.tx.v1beta1.GetTxsEventRequest")) @@ -330,6 +347,8 @@ func (x *fastReflection_GetTxsEventRequest) Mutable(fd protoreflect.FieldDescrip panic(fmt.Errorf("field page of message cosmos.tx.v1beta1.GetTxsEventRequest is not mutable")) case "cosmos.tx.v1beta1.GetTxsEventRequest.limit": panic(fmt.Errorf("field limit of message cosmos.tx.v1beta1.GetTxsEventRequest is not mutable")) + case "cosmos.tx.v1beta1.GetTxsEventRequest.query": + panic(fmt.Errorf("field query of message cosmos.tx.v1beta1.GetTxsEventRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.tx.v1beta1.GetTxsEventRequest")) @@ -355,6 +374,8 @@ func (x *fastReflection_GetTxsEventRequest) NewField(fd protoreflect.FieldDescri return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.tx.v1beta1.GetTxsEventRequest.limit": return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.tx.v1beta1.GetTxsEventRequest.query": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.tx.v1beta1.GetTxsEventRequest")) @@ -443,6 +464,10 @@ func (x *fastReflection_GetTxsEventRequest) ProtoMethods() *protoiface.Methods { if x.Limit != 0 { n += 1 + runtime.Sov(uint64(x.Limit)) } + l = len(x.Query) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -472,6 +497,13 @@ func (x *fastReflection_GetTxsEventRequest) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.Query) > 0 { + i -= len(x.Query) + copy(dAtA[i:], x.Query) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Query))) + i-- + dAtA[i] = 0x32 + } if x.Limit != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Limit)) i-- @@ -684,6 +716,38 @@ func (x *fastReflection_GetTxsEventRequest) ProtoMethods() *protoiface.Methods { break } } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -8961,7 +9025,8 @@ const ( type OrderBy int32 const ( - // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults + // to ASC in this case. OrderBy_ORDER_BY_UNSPECIFIED OrderBy = 0 // ORDER_BY_ASC defines ascending order OrderBy_ORDER_BY_ASC OrderBy = 1 @@ -9010,7 +9075,8 @@ func (OrderBy) EnumDescriptor() ([]byte, []int) { return file_cosmos_tx_v1beta1_service_proto_rawDescGZIP(), []int{0} } -// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC +// method. type BroadcastMode int32 const ( @@ -9021,11 +9087,11 @@ const ( // // Deprecated: Do not use. BroadcastMode_BROADCAST_MODE_BLOCK BroadcastMode = 1 - // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - // a CheckTx execution response only. + // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits + // for a CheckTx execution response only. BroadcastMode_BROADCAST_MODE_SYNC BroadcastMode = 2 - // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - // immediately. + // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + // returns immediately. BroadcastMode_BROADCAST_MODE_ASYNC BroadcastMode = 3 ) @@ -9080,6 +9146,8 @@ type GetTxsEventRequest struct { unknownFields protoimpl.UnknownFields // events is the list of transaction event type. + // Deprecated post v0.47.x: use query instead, which should contain a valid + // events query. Events []string `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` // pagination defines a pagination for the request. // Deprecated post v0.46.x: use page and limit instead. @@ -9087,11 +9155,15 @@ type GetTxsEventRequest struct { // Deprecated: Do not use. Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` OrderBy OrderBy `protobuf:"varint,3,opt,name=order_by,json=orderBy,proto3,enum=cosmos.tx.v1beta1.OrderBy" json:"order_by,omitempty"` - // page is the page number to query, starts at 1. If not provided, will default to first page. + // page is the page number to query, starts at 1. If not provided, will + // default to first page. Page uint64 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` // limit is the total number of results to be returned in the result page. // If left empty it will default to a value to be set by each app. Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + // query defines the transaction event query that is proxied to Tendermint's + // TxSearch RPC method. The query must be valid. + Query string `protobuf:"bytes,6,opt,name=query,proto3" json:"query,omitempty"` } func (x *GetTxsEventRequest) Reset() { @@ -9150,6 +9222,13 @@ func (x *GetTxsEventRequest) GetLimit() uint64 { return 0 } +func (x *GetTxsEventRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + // GetTxsEventResponse is the response type for the Service.TxsByEvents // RPC method. type GetTxsEventResponse struct { @@ -9536,7 +9615,8 @@ func (x *GetBlockWithTxsRequest) GetPagination() *v1beta1.PageRequest { return nil } -// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs +// method. // // Since: cosmos-sdk 0.45.2 type GetBlockWithTxsResponse struct { @@ -9934,7 +10014,7 @@ var file_cosmos_tx_v1beta1_service_proto_rawDesc = []byte{ 0x1c, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x01, 0x0a, 0x12, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xef, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x4a, 0x0a, 0x0a, 0x70, 0x61, @@ -9948,209 +10028,210 @@ var file_cosmos_tx_v1beta1_service_proto_rawDesc = []byte{ 0x65, 0x72, 0x42, 0x79, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xea, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x54, - 0x78, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x27, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xea, 0x01, + 0x0a, 0x13, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x03, 0x74, 0x78, 0x73, 0x12, 0x47, + 0x0a, 0x0c, 0x74, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0b, 0x74, 0x78, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x65, 0x0a, 0x12, 0x42, 0x72, + 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x74, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x6d, + 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x72, + 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, + 0x65, 0x22, 0x5c, 0x0a, 0x13, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x78, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x74, 0x78, 0x5f, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x74, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x57, 0x0a, 0x0f, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x29, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x54, 0x78, 0x42, 0x02, 0x18, 0x01, 0x52, 0x02, 0x74, 0x78, 0x12, 0x19, 0x0a, + 0x08, 0x74, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x74, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x6d, + 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, + 0x08, 0x67, 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, + 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x61, 0x73, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x07, 0x67, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x22, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x78, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x7d, 0x0a, 0x0d, 0x47, 0x65, 0x74, + 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x02, 0x74, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x02, 0x74, + 0x78, 0x12, 0x45, 0x0a, 0x0b, 0x74, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x74, 0x78, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x78, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0xf0, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, + 0x69, 0x74, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, + 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x54, 0x78, 0x52, 0x03, 0x74, 0x78, 0x73, 0x12, 0x34, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x49, 0x44, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x2d, 0x0a, + 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x47, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x0a, 0x0f, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x78, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x10, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x02, 0x74, 0x78, 0x22, 0x38, + 0x0a, 0x0f, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x25, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x54, 0x78, 0x52, 0x02, 0x74, 0x78, 0x22, 0x2d, 0x0a, 0x10, 0x54, 0x78, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x74, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x74, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x35, 0x0a, 0x14, 0x54, 0x78, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x4a, 0x73, 0x6f, 0x6e, 0x22, 0x3a, + 0x0a, 0x15, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6d, 0x69, 0x6e, 0x6f, + 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, + 0x6d, 0x69, 0x6e, 0x6f, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x22, 0x39, 0x0a, 0x14, 0x54, 0x78, + 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x5f, 0x62, 0x69, 0x6e, 0x61, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x42, + 0x69, 0x6e, 0x61, 0x72, 0x79, 0x22, 0x36, 0x0a, 0x15, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, + 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x4a, 0x73, 0x6f, 0x6e, 0x2a, 0x48, 0x0a, + 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x52, 0x44, 0x45, + 0x52, 0x5f, 0x42, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x42, 0x59, 0x5f, 0x41, + 0x53, 0x43, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x42, 0x59, + 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, 0x02, 0x2a, 0x80, 0x01, 0x0a, 0x0d, 0x42, 0x72, 0x6f, 0x61, + 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x42, 0x52, 0x4f, + 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x14, 0x42, 0x52, 0x4f, + 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x42, 0x4c, 0x4f, 0x43, + 0x4b, 0x10, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x42, 0x52, 0x4f, 0x41, 0x44, + 0x43, 0x41, 0x53, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x02, + 0x12, 0x18, 0x0a, 0x14, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x5f, 0x4d, 0x4f, + 0x44, 0x45, 0x5f, 0x41, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x03, 0x32, 0xaa, 0x09, 0x0a, 0x07, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x08, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, + 0x74, 0x65, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x69, 0x6d, 0x75, 0x6c, + 0x61, 0x74, 0x65, 0x12, 0x71, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x54, 0x78, 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x54, 0x78, 0x52, 0x03, 0x74, 0x78, 0x73, 0x12, 0x47, 0x0a, 0x0c, 0x74, 0x78, 0x5f, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, - 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0b, 0x74, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x73, 0x12, 0x4b, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x02, - 0x18, 0x01, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x65, 0x0a, 0x12, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, - 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, - 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x78, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, - 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x5c, 0x0a, 0x13, 0x42, - 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x74, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x74, - 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x57, 0x0a, 0x0f, 0x53, 0x69, 0x6d, - 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x02, - 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x42, - 0x02, 0x18, 0x01, 0x52, 0x02, 0x74, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x78, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x67, 0x61, - 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0x22, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, - 0x61, 0x73, 0x68, 0x22, 0x7d, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x02, 0x74, 0x78, 0x12, 0x45, 0x0a, 0x0b, 0x74, - 0x78, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x61, - 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x74, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x78, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, - 0x74, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf0, 0x01, 0x0a, - 0x17, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x78, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, - 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x03, 0x74, 0x78, - 0x73, 0x12, 0x34, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x52, 0x07, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, - 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x2c, 0x0a, 0x0f, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x39, 0x0a, - 0x10, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x25, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x2e, 0x47, 0x65, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x54, 0x78, 0x52, 0x02, 0x74, 0x78, 0x22, 0x38, 0x0a, 0x0f, 0x54, 0x78, 0x45, 0x6e, - 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x02, 0x74, - 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x52, 0x02, - 0x74, 0x78, 0x22, 0x2d, 0x0a, 0x10, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x78, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x35, 0x0a, 0x14, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, - 0x6e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x6d, 0x69, - 0x6e, 0x6f, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, - 0x6d, 0x69, 0x6e, 0x6f, 0x4a, 0x73, 0x6f, 0x6e, 0x22, 0x3a, 0x0a, 0x15, 0x54, 0x78, 0x45, 0x6e, - 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x42, 0x69, - 0x6e, 0x61, 0x72, 0x79, 0x22, 0x39, 0x0a, 0x14, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, - 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, - 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x22, - 0x36, 0x0a, 0x15, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x6d, 0x69, 0x6e, - 0x6f, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6d, - 0x69, 0x6e, 0x6f, 0x4a, 0x73, 0x6f, 0x6e, 0x2a, 0x48, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, - 0x42, 0x79, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x42, 0x59, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x42, 0x59, 0x5f, 0x41, 0x53, 0x43, 0x10, 0x01, 0x12, 0x11, - 0x0a, 0x0d, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x42, 0x59, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x10, - 0x02, 0x2a, 0x80, 0x01, 0x0a, 0x0d, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, - 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, - 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x14, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, - 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x01, 0x1a, 0x02, 0x08, - 0x01, 0x12, 0x17, 0x0a, 0x13, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x5f, 0x4d, - 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x42, 0x52, - 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x53, 0x59, - 0x4e, 0x43, 0x10, 0x03, 0x32, 0xaa, 0x09, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x7b, 0x0a, 0x08, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x63, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x73, 0x2f, + 0x7b, 0x68, 0x61, 0x73, 0x68, 0x7d, 0x12, 0x7f, 0x0a, 0x0b, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, + 0x61, 0x73, 0x74, 0x54, 0x78, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, + 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, + 0x61, 0x73, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, - 0x22, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x71, 0x0a, - 0x05, 0x47, 0x65, 0x74, 0x54, 0x78, 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, + 0x16, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x73, 0x12, 0x7c, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, 0x78, + 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x78, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, - 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1f, 0x12, 0x1d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x73, 0x2f, 0x7b, 0x68, 0x61, 0x73, 0x68, 0x7d, - 0x12, 0x7f, 0x0a, 0x0b, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x78, 0x12, - 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x78, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, - 0x63, 0x61, 0x73, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, - 0x73, 0x12, 0x7c, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, - 0x78, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x73, 0x12, - 0x97, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, - 0x54, 0x78, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x57, 0x69, 0x74, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, - 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x27, 0x12, 0x25, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x73, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x2f, 0x7b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x12, 0x79, 0x0a, 0x08, 0x54, 0x78, 0x44, - 0x65, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, - 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, - 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, - 0x63, 0x6f, 0x64, 0x65, 0x12, 0x79, 0x0a, 0x08, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, - 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, - 0x8e, 0x01, 0x0a, 0x0d, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, - 0x6f, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, - 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, - 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, - 0x1f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, - 0x12, 0x8e, 0x01, 0x0a, 0x0d, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, - 0x6e, 0x6f, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x41, - 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, + 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x78, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x74, 0x78, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x78, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x73, + 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x7b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x12, + 0x79, 0x0a, 0x08, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, - 0x22, 0x1f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x6d, 0x69, 0x6e, - 0x6f, 0x42, 0xb9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, - 0x74, 0x78, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x54, 0x58, 0xaa, - 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x54, 0x78, 0x2e, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, + 0x19, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x79, 0x0a, 0x08, 0x54, 0x78, + 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, + 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x8e, 0x01, 0x0a, 0x0d, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, + 0x6e, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, + 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x12, 0x8e, 0x01, 0x0a, 0x0d, 0x54, 0x78, 0x44, 0x65, 0x63, + 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x44, + 0x65, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x78, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x6d, + 0x69, 0x6e, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x63, 0x6f, 0x64, + 0x65, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x42, 0xb9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x74, 0x78, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, + 0x02, 0x03, 0x43, 0x54, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x54, + 0x78, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto index 16b3de0ddafc..3c5e5940bdc7 100644 --- a/proto/cosmos/tx/v1beta1/service.proto +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -37,7 +37,8 @@ service Service { // GetBlockWithTxs fetches a block with decoded txs. // // Since: cosmos-sdk 0.45.2 - rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { + rpc GetBlockWithTxs(GetBlockWithTxsRequest) + returns (GetBlockWithTxsResponse) { option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; } // TxDecode decodes the transaction. @@ -82,22 +83,33 @@ service Service { // RPC method. message GetTxsEventRequest { // events is the list of transaction event type. + // Deprecated post v0.47.x: use query instead, which should contain a valid + // events query. repeated string events = 1; + // pagination defines a pagination for the request. // Deprecated post v0.46.x: use page and limit instead. cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; OrderBy order_by = 3; - // page is the page number to query, starts at 1. If not provided, will default to first page. + + // page is the page number to query, starts at 1. If not provided, will + // default to first page. uint64 page = 4; + // limit is the total number of results to be returned in the result page. // If left empty it will default to a value to be set by each app. uint64 limit = 5; + + // query defines the transaction event query that is proxied to Tendermint's + // TxSearch RPC method. The query must be valid. + string query = 6; } // OrderBy defines the sorting order enum OrderBy { - // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults + // to ASC in this case. ORDER_BY_UNSPECIFIED = 0; // ORDER_BY_ASC defines ascending order ORDER_BY_ASC = 1; @@ -127,18 +139,19 @@ message BroadcastTxRequest { BroadcastMode mode = 2; } -// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC +// method. enum BroadcastMode { // zero-value for mode ordering BROADCAST_MODE_UNSPECIFIED = 0; // DEPRECATED: use BROADCAST_MODE_SYNC instead, // BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. BROADCAST_MODE_BLOCK = 1 [deprecated = true]; - // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - // a CheckTx execution response only. + // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits + // for a CheckTx execution response only. BROADCAST_MODE_SYNC = 2; - // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - // immediately. + // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + // returns immediately. BROADCAST_MODE_ASYNC = 3; } @@ -196,7 +209,8 @@ message GetBlockWithTxsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 2; } -// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs +// method. // // Since: cosmos-sdk 0.45.2 message GetBlockWithTxsResponse { diff --git a/types/tx/service.pb.go b/types/tx/service.pb.go index 4f388da53107..c029bb472b43 100644 --- a/types/tx/service.pb.go +++ b/types/tx/service.pb.go @@ -35,7 +35,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type OrderBy int32 const ( - // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults + // to ASC in this case. OrderBy_ORDER_BY_UNSPECIFIED OrderBy = 0 // ORDER_BY_ASC defines ascending order OrderBy_ORDER_BY_ASC OrderBy = 1 @@ -63,7 +64,8 @@ func (OrderBy) EnumDescriptor() ([]byte, []int) { return fileDescriptor_e0b00a618705eca7, []int{0} } -// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC +// method. type BroadcastMode int32 const ( @@ -72,11 +74,11 @@ const ( // DEPRECATED: use BROADCAST_MODE_SYNC instead, // BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. BroadcastMode_BROADCAST_MODE_BLOCK BroadcastMode = 1 // Deprecated: Do not use. - // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - // a CheckTx execution response only. + // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits + // for a CheckTx execution response only. BroadcastMode_BROADCAST_MODE_SYNC BroadcastMode = 2 - // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - // immediately. + // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + // returns immediately. BroadcastMode_BROADCAST_MODE_ASYNC BroadcastMode = 3 ) @@ -106,16 +108,22 @@ func (BroadcastMode) EnumDescriptor() ([]byte, []int) { // RPC method. type GetTxsEventRequest struct { // events is the list of transaction event type. + // Deprecated post v0.47.x: use query instead, which should contain a valid + // events query. Events []string `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` // pagination defines a pagination for the request. // Deprecated post v0.46.x: use page and limit instead. Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` // Deprecated: Do not use. OrderBy OrderBy `protobuf:"varint,3,opt,name=order_by,json=orderBy,proto3,enum=cosmos.tx.v1beta1.OrderBy" json:"order_by,omitempty"` - // page is the page number to query, starts at 1. If not provided, will default to first page. + // page is the page number to query, starts at 1. If not provided, will + // default to first page. Page uint64 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` // limit is the total number of results to be returned in the result page. // If left empty it will default to a value to be set by each app. Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + // query defines the transaction event query that is proxied to Tendermint's + // TxSearch RPC method. The query must be valid. + Query string `protobuf:"bytes,6,opt,name=query,proto3" json:"query,omitempty"` } func (m *GetTxsEventRequest) Reset() { *m = GetTxsEventRequest{} } @@ -187,6 +195,13 @@ func (m *GetTxsEventRequest) GetLimit() uint64 { return 0 } +func (m *GetTxsEventRequest) GetQuery() string { + if m != nil { + return m.Query + } + return "" +} + // GetTxsEventResponse is the response type for the Service.TxsByEvents // RPC method. type GetTxsEventResponse struct { @@ -641,7 +656,8 @@ func (m *GetBlockWithTxsRequest) GetPagination() *query.PageRequest { return nil } -// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs +// method. // // Since: cosmos-sdk 0.45.2 type GetBlockWithTxsResponse struct { @@ -1128,84 +1144,85 @@ func init() { func init() { proto.RegisterFile("cosmos/tx/v1beta1/service.proto", fileDescriptor_e0b00a618705eca7) } var fileDescriptor_e0b00a618705eca7 = []byte{ - // 1223 bytes of a gzipped FileDescriptorProto + // 1234 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4d, 0x4f, 0x1b, 0x47, 0x18, 0x66, 0x6d, 0x83, 0xcd, 0x6b, 0x08, 0xce, 0x40, 0xc0, 0x38, 0xc4, 0x98, 0x0d, 0x1f, 0x8e, 0x55, 0xbc, 0x0a, 0x4d, 0xaa, 0x24, 0xaa, 0x54, 0xe1, 0x8f, 0x50, 0x92, 0x26, 0x44, 0x6b, 0xaa, 0x28, 0x55, 0x25, 0x6b, 0x6d, 0x4f, 0xec, 0x6d, 0xec, 0x5d, 0xe3, 0x19, 0xd0, 0x5a, 0x14, 0xb5, - 0xea, 0xb1, 0x87, 0xaa, 0x52, 0x0f, 0xfd, 0x0f, 0xfd, 0x25, 0x3d, 0x46, 0xea, 0xa5, 0xbd, 0x55, - 0xd0, 0x53, 0x4f, 0xfd, 0x09, 0xd5, 0xce, 0x8c, 0xed, 0x5d, 0x7b, 0x17, 0x43, 0x2e, 0x30, 0xb3, - 0xf3, 0xbc, 0xef, 0xf3, 0xcc, 0x3b, 0x33, 0xcf, 0x8c, 0x61, 0xb5, 0x6a, 0x92, 0x96, 0x49, 0x14, - 0x6a, 0x29, 0x27, 0xf7, 0x2b, 0x98, 0x6a, 0xf7, 0x15, 0x82, 0x3b, 0x27, 0x7a, 0x15, 0x67, 0xdb, - 0x1d, 0x93, 0x9a, 0xe8, 0x26, 0x07, 0x64, 0xa9, 0x95, 0x15, 0x80, 0xc4, 0x4a, 0xdd, 0x34, 0xeb, - 0x4d, 0xac, 0x68, 0x6d, 0x5d, 0xd1, 0x0c, 0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 0xa7, 0xf1, 0x49, - 0xf6, 0x91, 0x77, 0xe4, 0x7f, 0x25, 0x98, 0x77, 0xcd, 0x8d, 0xb4, 0x4d, 0x83, 0x60, 0xb4, 0x05, - 0x41, 0x6a, 0xf1, 0x99, 0x45, 0x77, 0x6e, 0x79, 0x70, 0x1e, 0x5a, 0xaa, 0x8d, 0x40, 0x7b, 0x30, - 0x43, 0xad, 0x72, 0x47, 0xc4, 0x91, 0x78, 0x80, 0x45, 0xac, 0xbb, 0xe6, 0xcb, 0xd6, 0xd3, 0x11, - 0x28, 0xc0, 0x6a, 0x94, 0xf6, 0xdb, 0x04, 0x3d, 0x77, 0x95, 0x2d, 0xc8, 0xca, 0xb6, 0x35, 0xb6, - 0x6c, 0x3c, 0x7a, 0xa4, 0x6e, 0x0b, 0x30, 0x49, 0x4d, 0xaa, 0x35, 0x45, 0x05, 0x78, 0x47, 0xc6, - 0x80, 0x72, 0x1d, 0x53, 0xab, 0x55, 0x35, 0x42, 0x6d, 0x19, 0x7c, 0x1d, 0x97, 0x21, 0x42, 0xad, - 0x72, 0xa5, 0x4b, 0xb1, 0x3d, 0x5f, 0x29, 0x3d, 0xa3, 0x86, 0xa9, 0x95, 0xb3, 0xbb, 0xe8, 0x01, - 0x84, 0x5a, 0x66, 0x0d, 0xb3, 0x45, 0xbc, 0xb1, 0x93, 0xf2, 0x28, 0x43, 0x3f, 0xdf, 0x0b, 0xb3, - 0x86, 0x55, 0x86, 0x96, 0xbf, 0x86, 0x79, 0x17, 0x8d, 0x28, 0x69, 0x11, 0xa2, 0x8e, 0x4a, 0x31, - 0xaa, 0xab, 0x16, 0x0a, 0x06, 0x85, 0x92, 0x5f, 0xc3, 0x5c, 0x49, 0x6f, 0x1d, 0x37, 0x35, 0xda, - 0xdb, 0x35, 0xe8, 0x1e, 0x04, 0xa8, 0x25, 0x12, 0x7a, 0xaf, 0x15, 0x2b, 0x50, 0x80, 0x5a, 0xae, - 0xc9, 0x06, 0x5c, 0x93, 0x95, 0x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b, 0xaf, 0x4a, + 0xd9, 0x57, 0x5a, 0x1d, 0x8b, 0x9c, 0xb9, 0x40, 0x5c, 0x52, 0x1d, 0xd1, 0xe8, 0x21, 0x44, 0xcc, + 0x4e, 0x0d, 0x77, 0xca, 0x95, 0x6e, 0x3c, 0x98, 0x92, 0xd2, 0x37, 0x76, 0x12, 0xd9, 0x91, 0x3a, + 0x67, 0x0f, 0x6c, 0x48, 0xae, 0xab, 0x86, 0x4d, 0xde, 0x40, 0x08, 0x42, 0x6d, 0xad, 0x8e, 0xe3, + 0xa1, 0x94, 0x94, 0x0e, 0xa9, 0xac, 0x8d, 0x16, 0x60, 0xb2, 0xa9, 0xb7, 0x74, 0x1a, 0x9f, 0x64, + 0x83, 0xbc, 0x63, 0x8f, 0x32, 0x35, 0xf1, 0xa9, 0x94, 0x94, 0x9e, 0x56, 0x79, 0x47, 0xfe, 0x47, + 0x82, 0x79, 0xd7, 0x8a, 0x49, 0xdb, 0x34, 0x08, 0x46, 0x5b, 0x10, 0xa4, 0x16, 0x5f, 0x6f, 0x74, + 0xe7, 0x96, 0x87, 0x92, 0x43, 0x4b, 0xb5, 0x11, 0x68, 0x0f, 0x66, 0xa8, 0x55, 0xee, 0x88, 0x38, + 0x12, 0x0f, 0xb0, 0x88, 0x75, 0x57, 0x15, 0xd8, 0x2e, 0x3b, 0x02, 0x05, 0x58, 0x8d, 0xd2, 0x7e, + 0x9b, 0xa0, 0xe7, 0xae, 0x62, 0x06, 0x59, 0x31, 0xb7, 0xc6, 0x16, 0x93, 0x47, 0x8f, 0x54, 0x73, + 0x01, 0x26, 0xa9, 0x49, 0xb5, 0xa6, 0xa8, 0x0b, 0xef, 0xc8, 0x18, 0x50, 0xae, 0x63, 0x6a, 0xb5, + 0xaa, 0x46, 0xa8, 0x2d, 0x83, 0xef, 0xee, 0x32, 0x44, 0xa8, 0x55, 0xae, 0x74, 0x29, 0xb6, 0xd7, + 0x2b, 0xa5, 0x67, 0xd4, 0x30, 0xb5, 0x72,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 0x8b, 0xe4, 0xc4, 0x9f, 0x17, 0xc9, 0x89, 0xaf, 0x36, 0xea, 0x3a, 0x6d, 0x1c, 0x57, 0xb2, + 0x55, 0xb3, 0xd5, 0x4b, 0xc2, 0xff, 0x6d, 0x93, 0xda, 0xbb, 0xde, 0xaf, 0x22, 0xab, 0x32, 0xc5, + 0x7e, 0x13, 0x7d, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x24, 0x1f, 0x2c, 0x10, 0x0e, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1634,6 +1651,13 @@ func (m *GetTxsEventRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintService(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0x32 + } if m.Limit != 0 { i = encodeVarintService(dAtA, i, uint64(m.Limit)) i-- @@ -2376,6 +2400,10 @@ func (m *GetTxsEventRequest) Size() (n int) { if m.Limit != 0 { n += 1 + sovService(uint64(m.Limit)) } + l = len(m.Query) + if l > 0 { + n += 1 + l + sovService(uint64(l)) + } return n } @@ -2807,6 +2835,38 @@ func (m *GetTxsEventRequest) Unmarshal(dAtA []byte) error { break } } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipService(dAtA[iNdEx:]) diff --git a/x/auth/tx/query.go b/x/auth/tx/query.go index 7028a1c4f163..ed19de9b35db 100644 --- a/x/auth/tx/query.go +++ b/x/auth/tx/query.go @@ -3,9 +3,7 @@ package tx import ( "context" "encoding/hex" - "errors" "fmt" - "strings" "time" coretypes "github.com/tendermint/tendermint/rpc/core/types" @@ -15,55 +13,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// QueryTxsByEvents performs a search for transactions for a given set of events -// via the Tendermint RPC. An event takes the form of: -// "{eventAttribute}.{attributeKey} = '{attributeValue}'". Each event is -// concatenated with an 'AND' operand. It returns a slice of Info object -// containing txs and metadata. An error is returned if the query fails. -// If an empty string is provided it will order txs by asc -func QueryTxsByEvents(clientCtx client.Context, events []string, page, limit int, orderBy string) (*sdk.SearchTxsResult, error) { - if len(events) == 0 { - return nil, errors.New("must declare at least one event to search") - } - - if page <= 0 { - return nil, errors.New("page must be greater than 0") - } - - if limit <= 0 { - return nil, errors.New("limit must be greater than 0") - } - - // XXX: implement ANY - query := strings.Join(events, " AND ") - - node, err := clientCtx.GetNode() - if err != nil { - return nil, err - } - - // TODO: this may not always need to be proven - // https://github.com/cosmos/cosmos-sdk/issues/6807 - resTxs, err := node.TxSearch(context.Background(), query, true, &page, &limit, orderBy) - if err != nil { - return nil, err - } - - resBlocks, err := getBlocksForTxResults(clientCtx, resTxs.Txs) - if err != nil { - return nil, err - } - - txs, err := formatTxResults(clientCtx.TxConfig, resTxs.Txs, resBlocks) - if err != nil { - return nil, err - } - - result := sdk.NewSearchTxsResult(uint64(resTxs.TotalCount), uint64(len(txs)), uint64(page), uint64(limit), txs) - - return result, nil -} - // QueryTx queries for a single transaction by a hash string in hex format. An // error is returned if the transaction does not exist or cannot be queried. func QueryTx(clientCtx client.Context, hashHexStr string) (*sdk.TxResponse, error) { diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index e06aab1d4676..5015a1d36716 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -3,7 +3,6 @@ package tx import ( "context" "fmt" - "regexp" "strings" gogogrpc "github.com/cosmos/gogoproto/grpc" @@ -41,16 +40,7 @@ func NewTxServer(clientCtx client.Context, simulate baseAppSimulateFn, interface } } -var ( - _ txtypes.ServiceServer = txServer{} - - // EventRegex checks that an event string is formatted with {alphabetic}.{alphabetic}={value} - EventRegex = regexp.MustCompile(`^[a-zA-Z_]+\.[a-zA-Z_]+=\S+$`) -) - -const ( - eventFormat = "{eventType}.{eventAttribute}={value}" -) +var _ txtypes.ServiceServer = txServer{} // GetTxsEvent implements the ServiceServer.TxsByEvents RPC method. func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventRequest) (*txtypes.GetTxsEventResponse, error) { @@ -58,9 +48,9 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque return nil, status.Error(codes.InvalidArgument, "request cannot be nil") } - page := int(req.Page) // Tendermint node.TxSearch that is used for querying txs defines pages starting from 1, // so we default to 1 if not provided in the request. + page := int(req.Page) if page == 0 { page = 1 } @@ -69,24 +59,38 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque if limit == 0 { limit = query.DefaultLimit } + orderBy := parseOrderBy(req.OrderBy) - if len(req.Events) == 0 { - return nil, status.Error(codes.InvalidArgument, "must declare at least one event to search") + node, err := s.clientCtx.GetNode() + if err != nil { + return nil, err + } + + resTxs, err := node.TxSearch(context.Background(), query, false, &page, &limit, orderBy) + if err != nil { + return nil, err } - for _, event := range req.Events { - if !EventRegex.Match([]byte(event)) { - return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("invalid event; event %s should be of the format: %s", event, eventFormat)) - } + resBlocks, err := getBlocksForTxResults(s.clientCtx, resTxs.Txs) + if err != nil { + return nil, err } - result, err := QueryTxsByEvents(s.clientCtx, req.Events, page, limit, orderBy) + txs, err := formatTxResults(s.clientCtx.TxConfig, resTxs.Txs, resBlocks) if err != nil { return nil, err } - // Create a proto codec, we need it to unmarshal the tx bytes. + result := sdk.NewSearchTxsResult( + uint64(resTxs.TotalCount), + uint64(len(txs)), + uint64(page), + uint64(limit), + txs, + ) + + // create a proto codec, as we need it to unmarshal the tx bytes txsList := make([]*txtypes.Tx, len(result.Txs)) for i, tx := range result.Txs { diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index b34d77df8dfa..cb04fc3198f7 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -412,7 +412,7 @@ var xxx_messageInfo_MsgUndelegate proto.InternalMessageInfo // MsgUndelegateResponse defines the Msg/Undelegate response type. type MsgUndelegateResponse struct { CompletionTime time.Time `protobuf:"bytes,1,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` - // amount returns the amount undelegated coins + // amount returns the amount of undelegated coins // // Since: cosmos-sdk 0.48 Amount types1.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` From a47cfb7223680ffa38ee2d10f021d0cbda5aa2e3 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 24 Jan 2023 12:33:05 -0500 Subject: [PATCH 02/24] updates --- x/auth/tx/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 5015a1d36716..e3351dcf687f 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -67,7 +67,7 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque return nil, err } - resTxs, err := node.TxSearch(context.Background(), query, false, &page, &limit, orderBy) + resTxs, err := node.TxSearch(context.Background(), req.Query, false, &page, &limit, orderBy) if err != nil { return nil, err } From 8df20c434eef2a47a0278c5c183cb4a1e1cde0a3 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Tue, 24 Jan 2023 12:34:12 -0500 Subject: [PATCH 03/24] updates --- x/auth/tx/service.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index e3351dcf687f..582189b7c1f6 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -47,6 +47,9 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque if req == nil { return nil, status.Error(codes.InvalidArgument, "request cannot be nil") } + if len(req.Query) == 0 { + return nil, status.Error(codes.InvalidArgument, "query cannot be empty") + } // Tendermint node.TxSearch that is used for querying txs defines pages starting from 1, // so we default to 1 if not provided in the request. From 82dc1027971f21a94d9d55dd63197f008ba53d2e Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 15:08:45 -0500 Subject: [PATCH 04/24] updates --- x/auth/client/cli/query.go | 191 +++++++++++++++++-------------------- x/auth/tx/query.go | 44 +++++++++ x/auth/tx/service.go | 44 +-------- 3 files changed, 132 insertions(+), 147 deletions(-) diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 11f22e8dde74..b376b82bf7c3 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -7,27 +7,25 @@ import ( "strings" "github.com/spf13/cobra" - tmtypes "github.com/tendermint/tendermint/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/query" + querytypes "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/version" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/cosmos/cosmos-sdk/x/auth/types" ) const ( - flagEvents = "events" - flagType = "type" + flagQuery = "query" + flagType = "type" + flagOrderBy = "order_by" typeHash = "hash" typeAccSeq = "acc_seq" typeSig = "signature" - - eventFormat = "{eventType}.{eventAttribute}={value}" ) // GetQueryCmd returns the transaction commands for this module @@ -264,52 +262,31 @@ func QueryTxsByEventsCmd() *cobra.Command { Long: strings.TrimSpace( fmt.Sprintf(` Search for transactions that match the exact given events where results are paginated. -Each event takes the form of '%s'. Please refer -to each module's documentation for the full set of events to query for. Each module -documents its respective events under 'xx_events.md'. +The events query is directly passed to Tendermint's RPC TxSearch method and must +conform to Tendermint's query syntax. -Example: -$ %s query txs --%s 'message.sender=cosmos1...&message.action=withdraw_delegator_reward' --page 1 --limit 30 -`, eventFormat, version.AppName, flagEvents), +Please refer to each module's documentation for the full set of events to query +for. Each module documents its respective events under 'xx_events.md'. +`, + version.AppName, flagQuery, + ), + ), + Example: fmt.Sprintf( + "$ %s query txs --%s 'message.sender='cosmos1...' AND message.action='withdraw_delegator_reward' AND tx.height > 7' --page 1 --limit 30", + version.AppName, flagQuery, ), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } - eventsRaw, _ := cmd.Flags().GetString(flagEvents) - eventsStr := strings.Trim(eventsRaw, "'") - - var events []string - if strings.Contains(eventsStr, "&") { - events = strings.Split(eventsStr, "&") - } else { - events = append(events, eventsStr) - } - - var tmEvents []string - - for _, event := range events { - if !strings.Contains(event, "=") { - return fmt.Errorf("invalid event; event %s should be of the format: %s", event, eventFormat) - } else if strings.Count(event, "=") > 1 { - return fmt.Errorf("invalid event; event %s should be of the format: %s", event, eventFormat) - } - - tokens := strings.Split(event, "=") - if tokens[0] == tmtypes.TxHeightKey { - event = fmt.Sprintf("%s=%s", tokens[0], tokens[1]) - } else { - event = fmt.Sprintf("%s='%s'", tokens[0], tokens[1]) - } - - tmEvents = append(tmEvents, event) - } + query, _ := cmd.Flags().GetString(flagQuery) page, _ := cmd.Flags().GetInt(flags.FlagPage) limit, _ := cmd.Flags().GetInt(flags.FlagLimit) + orderBy, _ := cmd.Flags().GetString(flagOrderBy) - txs, err := authtx.QueryTxsByEvents(clientCtx, tmEvents, page, limit, "") + txs, err := authtx.GetTxsByEvents(clientCtx, page, limit, query, orderBy) if err != nil { return err } @@ -319,10 +296,11 @@ $ %s query txs --%s 'message.sender=cosmos1...&message.action=withdraw_delegator } flags.AddQueryFlagsToCmd(cmd) - cmd.Flags().Int(flags.FlagPage, query.DefaultPage, "Query a specific page of paginated results") - cmd.Flags().Int(flags.FlagLimit, query.DefaultLimit, "Query number of transactions results per page returned") - cmd.Flags().String(flagEvents, "", fmt.Sprintf("list of transaction events in the form of %s", eventFormat)) - cmd.MarkFlagRequired(flagEvents) + cmd.Flags().Int(flags.FlagPage, querytypes.DefaultPage, "Query a specific page of paginated results") + cmd.Flags().Int(flags.FlagLimit, querytypes.DefaultLimit, "Query number of transactions results per page returned") + cmd.Flags().String(flagQuery, "", "The transactions events query per Tendermint's query semantics") + cmd.Flags().String(flagOrderBy, "", "The ordering semantics (asc|dsc)") + cmd.MarkFlagRequired(flagQuery) return cmd } @@ -352,71 +330,74 @@ $ %s query tx --%s=%s , switch typ { case typeHash: - { - if args[0] == "" { - return fmt.Errorf("argument should be a tx hash") - } - - // If hash is given, then query the tx by hash. - output, err := authtx.QueryTx(clientCtx, args[0]) - if err != nil { - return err - } - - if output.Empty() { - return fmt.Errorf("no transaction found with hash %s", args[0]) - } - - return clientCtx.PrintProto(output) + if args[0] == "" { + return fmt.Errorf("argument should be a tx hash") + } + + // if hash is given, then query the tx by hash + output, err := authtx.QueryTx(clientCtx, args[0]) + if err != nil { + return err } + + if output.Empty() { + return fmt.Errorf("no transaction found with hash %s", args[0]) + } + + return clientCtx.PrintProto(output) + case typeSig: - { - sigParts, err := ParseSigArgs(args) - if err != nil { - return err - } - tmEvents := make([]string, len(sigParts)) - for i, sig := range sigParts { - tmEvents[i] = fmt.Sprintf("%s.%s='%s'", sdk.EventTypeTx, sdk.AttributeKeySignature, sig) - } - - txs, err := authtx.QueryTxsByEvents(clientCtx, tmEvents, query.DefaultPage, query.DefaultLimit, "") - if err != nil { - return err - } - if len(txs.Txs) == 0 { - return fmt.Errorf("found no txs matching given signatures") - } - if len(txs.Txs) > 1 { - // This case means there's a bug somewhere else in the code. Should not happen. - return errors.ErrLogic.Wrapf("found %d txs matching given signatures", len(txs.Txs)) - } - - return clientCtx.PrintProto(txs.Txs[0]) + sigParts, err := ParseSigArgs(args) + if err != nil { + return err } + + events := make([]string, len(sigParts)) + for i, sig := range sigParts { + events[i] = fmt.Sprintf("%s.%s='%s'", sdk.EventTypeTx, sdk.AttributeKeySignature, sig) + } + + query := strings.Join(events, " AND ") + + txs, err := authtx.GetTxsByEvents(clientCtx, querytypes.DefaultPage, querytypes.DefaultLimit, query, "") + if err != nil { + return err + } + + if len(txs.Txs) == 0 { + return fmt.Errorf("found no txs matching given signatures") + } + if len(txs.Txs) > 1 { + // This case means there's a bug somewhere else in the code as this + // should not happen. + return errors.ErrLogic.Wrapf("found %d txs matching given signatures", len(txs.Txs)) + } + + return clientCtx.PrintProto(txs.Txs[0]) + case typeAccSeq: - { - if args[0] == "" { - return fmt.Errorf("`acc_seq` type takes an argument '/'") - } - - tmEvents := []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, args[0]), - } - txs, err := authtx.QueryTxsByEvents(clientCtx, tmEvents, query.DefaultPage, query.DefaultLimit, "") - if err != nil { - return err - } - if len(txs.Txs) == 0 { - return fmt.Errorf("found no txs matching given address and sequence combination") - } - if len(txs.Txs) > 1 { - // This case means there's a bug somewhere else in the code. Should not happen. - return fmt.Errorf("found %d txs matching given address and sequence combination", len(txs.Txs)) - } - - return clientCtx.PrintProto(txs.Txs[0]) + if args[0] == "" { + return fmt.Errorf("`acc_seq` type takes an argument '/'") } + + query := fmt.Sprintf("%s.%s='%s'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, args[0]) + + txs, err := authtx.GetTxsByEvents(clientCtx, querytypes.DefaultPage, querytypes.DefaultLimit, query, "") + if err != nil { + return err + } + + if len(txs.Txs) == 0 { + return fmt.Errorf("found no txs matching given address and sequence combination") + } + if len(txs.Txs) > 1 { + // This case means there's a bug somewhere else in the code as this + // should not happen. + return fmt.Errorf("found %d txs matching given address and sequence combination", len(txs.Txs)) + } + + return clientCtx.PrintProto(txs.Txs[0]) + default: return fmt.Errorf("unknown --%s value %s", flagType, typ) } diff --git a/x/auth/tx/query.go b/x/auth/tx/query.go index ed19de9b35db..f66f35172d43 100644 --- a/x/auth/tx/query.go +++ b/x/auth/tx/query.go @@ -3,6 +3,7 @@ package tx import ( "context" "encoding/hex" + "errors" "fmt" "time" @@ -11,8 +12,51 @@ import ( "github.com/cosmos/cosmos-sdk/client" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + querytypes "github.com/cosmos/cosmos-sdk/types/query" ) +// GetTxsByEvents retrieves a list of paginated transactions from Tendermint's +// TxSearch RPC method given a set of pagination criteria and an events query. +// Note, the events query must be valid based on Tendermint's query semantics. +// An error is returned if the query or parsing fails. +func GetTxsByEvents(clientCtx client.Context, page, limit int, query, orderBy string) (*sdk.SearchTxsResult, error) { + if len(query) == 0 { + return nil, errors.New("query cannot be empty") + } + + // Tendermint node.TxSearch that is used for querying txs defines pages + // starting from 1, so we default to 1 if not provided in the request. + if page <= 0 { + page = 1 + } + + if limit <= 0 { + limit = querytypes.DefaultLimit + } + + node, err := clientCtx.GetNode() + if err != nil { + return nil, err + } + + resTxs, err := node.TxSearch(context.Background(), query, false, &page, &limit, orderBy) + if err != nil { + return nil, err + } + + resBlocks, err := getBlocksForTxResults(clientCtx, resTxs.Txs) + if err != nil { + return nil, err + } + + txs, err := formatTxResults(clientCtx.TxConfig, resTxs.Txs, resBlocks) + if err != nil { + return nil, err + } + + return sdk.NewSearchTxsResult(uint64(resTxs.TotalCount), uint64(len(txs)), uint64(page), uint64(limit), txs), nil +} + // QueryTx queries for a single transaction by a hash string in hex format. An // error is returned if the transaction does not exist or cannot be queried. func QueryTx(clientCtx client.Context, hashHexStr string) (*sdk.TxResponse, error) { diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 582189b7c1f6..cb69d58ced30 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -47,55 +47,15 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque if req == nil { return nil, status.Error(codes.InvalidArgument, "request cannot be nil") } - if len(req.Query) == 0 { - return nil, status.Error(codes.InvalidArgument, "query cannot be empty") - } - - // Tendermint node.TxSearch that is used for querying txs defines pages starting from 1, - // so we default to 1 if not provided in the request. - page := int(req.Page) - if page == 0 { - page = 1 - } - - limit := int(req.Limit) - if limit == 0 { - limit = query.DefaultLimit - } orderBy := parseOrderBy(req.OrderBy) - node, err := s.clientCtx.GetNode() - if err != nil { - return nil, err - } - - resTxs, err := node.TxSearch(context.Background(), req.Query, false, &page, &limit, orderBy) - if err != nil { - return nil, err - } - - resBlocks, err := getBlocksForTxResults(s.clientCtx, resTxs.Txs) + result, err := GetTxsByEvents(s.clientCtx, int(req.Page), int(req.Limit), req.Query, orderBy) if err != nil { - return nil, err + return nil, status.Error(codes.Internal, err.Error()) } - txs, err := formatTxResults(s.clientCtx.TxConfig, resTxs.Txs, resBlocks) - if err != nil { - return nil, err - } - - result := sdk.NewSearchTxsResult( - uint64(resTxs.TotalCount), - uint64(len(txs)), - uint64(page), - uint64(limit), - txs, - ) - - // create a proto codec, as we need it to unmarshal the tx bytes txsList := make([]*txtypes.Tx, len(result.Txs)) - for i, tx := range result.Txs { protoTx, ok := tx.Tx.GetCachedValue().(*txtypes.Tx) if !ok { From f743d0bae5d6fd73b84e865bce0356e665af832e Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 15:13:28 -0500 Subject: [PATCH 05/24] updates --- x/auth/client/cli/query.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index b376b82bf7c3..d7be24a654cd 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -259,20 +259,15 @@ func QueryTxsByEventsCmd() *cobra.Command { cmd := &cobra.Command{ Use: "txs", Short: "Query for paginated transactions that match a set of events", - Long: strings.TrimSpace( - fmt.Sprintf(` -Search for transactions that match the exact given events where results are paginated. + Long: `Search for transactions that match the exact given events where results are paginated. The events query is directly passed to Tendermint's RPC TxSearch method and must conform to Tendermint's query syntax. Please refer to each module's documentation for the full set of events to query for. Each module documents its respective events under 'xx_events.md'. `, - version.AppName, flagQuery, - ), - ), Example: fmt.Sprintf( - "$ %s query txs --%s 'message.sender='cosmos1...' AND message.action='withdraw_delegator_reward' AND tx.height > 7' --page 1 --limit 30", + "$ %s query txs --%s \"message.sender='cosmos1...' AND message.action='withdraw_delegator_reward' AND tx.height > 7\" --page 1 --limit 30", version.AppName, flagQuery, ), RunE: func(cmd *cobra.Command, args []string) error { From 0df2abdccc97bfeed37b3728f0f0ca206643ea30 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 15:14:10 -0500 Subject: [PATCH 06/24] updates --- x/auth/client/cli/query.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index d7be24a654cd..5fccb103d4de 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -267,8 +267,8 @@ Please refer to each module's documentation for the full set of events to query for. Each module documents its respective events under 'xx_events.md'. `, Example: fmt.Sprintf( - "$ %s query txs --%s \"message.sender='cosmos1...' AND message.action='withdraw_delegator_reward' AND tx.height > 7\" --page 1 --limit 30", - version.AppName, flagQuery, + "$ %s query txs --query \"message.sender='cosmos1...' AND message.action='withdraw_delegator_reward' AND tx.height > 7\" --page 1 --limit 30", + version.AppName, ), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) From 20579ab3a3639470580be6e8346598c14013ca30 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 15:15:58 -0500 Subject: [PATCH 07/24] updates --- x/auth/tx/query.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/auth/tx/query.go b/x/auth/tx/query.go index f66f35172d43..19bcb091f76d 100644 --- a/x/auth/tx/query.go +++ b/x/auth/tx/query.go @@ -18,7 +18,10 @@ import ( // GetTxsByEvents retrieves a list of paginated transactions from Tendermint's // TxSearch RPC method given a set of pagination criteria and an events query. // Note, the events query must be valid based on Tendermint's query semantics. -// An error is returned if the query or parsing fails. +// An error is returned if the query or parsing fails or if the query is empty. +// +// Note, if an empty orderBy is provided, the default behavior is ascending. If +// negative values are provided for page or limit, defaults will be used. func GetTxsByEvents(clientCtx client.Context, page, limit int, query, orderBy string) (*sdk.SearchTxsResult, error) { if len(query) == 0 { return nil, errors.New("query cannot be empty") From 3bdab1f807d5b964d4ba9b88b35055a86f131b3e Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 15:20:28 -0500 Subject: [PATCH 08/24] updates --- CHANGELOG.md | 5 +++++ x/auth/client/cli/query.go | 6 +++--- x/auth/tx/query.go | 4 ++-- x/auth/tx/service.go | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f4c8b5699a..32d5d57bb289 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Allow transaction event queries to directly passed to Tendermint, which will allow for full query operator support, e.g. `>`. * (x/auth/tx) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove `.Type()` and `Route()` methods from all msgs and `legacytx.LegacyMsg` interface. * [#14691](https://github.com/cosmos/cosmos-sdk/pull/14691) Change behavior of `sdk.StringifyEvents` to not flatten events attributes by events type. * This change only affects ABCI message logs, and not the actual events. @@ -166,6 +167,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Refactor transaction searching: + * Refactor `QueryTxsByEvents` to accept a `query` of type `string` instead of `events` of type `[]string` + * Pass `prove=false` to Tendermint's `TxSearch` RPC method + * Refactor CLI methods to accept `--query` flag instead of `--events` * (x/simulation) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove the `MsgType` field from `simulation.OperationInput` struct. * (crypto/keyring) [#13734](https://github.com/cosmos/cosmos-sdk/pull/13834) The keyring's `Sign` method now takes a new `signMode` argument. It is only used if the signing key is a Ledger hardware device. You can set it to 0 in all other cases. * (x/evidence) [14724](https://github.com/cosmos/cosmos-sdk/pull/14724) Extract Evidence in its own go.mod and rename the package to `cosmossdk.io/x/evidence`. diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 5fccb103d4de..9dc849ae5786 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -281,7 +281,7 @@ for. Each module documents its respective events under 'xx_events.md'. limit, _ := cmd.Flags().GetInt(flags.FlagLimit) orderBy, _ := cmd.Flags().GetString(flagOrderBy) - txs, err := authtx.GetTxsByEvents(clientCtx, page, limit, query, orderBy) + txs, err := authtx.QueryTxsByEvents(clientCtx, page, limit, query, orderBy) if err != nil { return err } @@ -354,7 +354,7 @@ $ %s query tx --%s=%s , query := strings.Join(events, " AND ") - txs, err := authtx.GetTxsByEvents(clientCtx, querytypes.DefaultPage, querytypes.DefaultLimit, query, "") + txs, err := authtx.QueryTxsByEvents(clientCtx, querytypes.DefaultPage, querytypes.DefaultLimit, query, "") if err != nil { return err } @@ -377,7 +377,7 @@ $ %s query tx --%s=%s , query := fmt.Sprintf("%s.%s='%s'", sdk.EventTypeTx, sdk.AttributeKeyAccountSequence, args[0]) - txs, err := authtx.GetTxsByEvents(clientCtx, querytypes.DefaultPage, querytypes.DefaultLimit, query, "") + txs, err := authtx.QueryTxsByEvents(clientCtx, querytypes.DefaultPage, querytypes.DefaultLimit, query, "") if err != nil { return err } diff --git a/x/auth/tx/query.go b/x/auth/tx/query.go index 19bcb091f76d..0251ef8f564c 100644 --- a/x/auth/tx/query.go +++ b/x/auth/tx/query.go @@ -15,14 +15,14 @@ import ( querytypes "github.com/cosmos/cosmos-sdk/types/query" ) -// GetTxsByEvents retrieves a list of paginated transactions from Tendermint's +// QueryTxsByEvents retrieves a list of paginated transactions from Tendermint's // TxSearch RPC method given a set of pagination criteria and an events query. // Note, the events query must be valid based on Tendermint's query semantics. // An error is returned if the query or parsing fails or if the query is empty. // // Note, if an empty orderBy is provided, the default behavior is ascending. If // negative values are provided for page or limit, defaults will be used. -func GetTxsByEvents(clientCtx client.Context, page, limit int, query, orderBy string) (*sdk.SearchTxsResult, error) { +func QueryTxsByEvents(clientCtx client.Context, page, limit int, query, orderBy string) (*sdk.SearchTxsResult, error) { if len(query) == 0 { return nil, errors.New("query cannot be empty") } diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index cb69d58ced30..12ea80bfbfde 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -50,7 +50,7 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque orderBy := parseOrderBy(req.OrderBy) - result, err := GetTxsByEvents(s.clientCtx, int(req.Page), int(req.Limit), req.Query, orderBy) + result, err := QueryTxsByEvents(s.clientCtx, int(req.Page), int(req.Limit), req.Query, orderBy) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } From 0afa78f77764f9f367cada75b475c58871bcead3 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 18:34:38 -0500 Subject: [PATCH 09/24] updates --- x/gov/client/utils/query.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index abdf2213d5fb..7a1854d07b92 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -2,6 +2,7 @@ package utils import ( "fmt" + "strings" "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" @@ -443,13 +444,15 @@ func QueryProposalByID(proposalID uint64, clientCtx client.Context, queryRoute s // In searching for events, we search for both `Type()`s, and we use the // `combineEvents` function here to merge events. func combineEvents(clientCtx client.Context, page int, eventGroups ...[]string) (*sdk.SearchTxsResult, error) { - // Only the Txs field will be populated in the final SearchTxsResult. + // only the Txs field will be populated in the final SearchTxsResult allTxs := []*sdk.TxResponse{} for _, events := range eventGroups { - res, err := authtx.QueryTxsByEvents(clientCtx, events, page, defaultLimit, "") + q := strings.Join(events, " AND ") + res, err := authtx.QueryTxsByEvents(clientCtx, page, defaultLimit, q, "") if err != nil { return nil, err } + allTxs = append(allTxs, res.Txs...) } From bee3970ae932775d1604195fc6dde840733287c4 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 18:35:43 -0500 Subject: [PATCH 10/24] updates --- x/auth/client/cli/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 9dc849ae5786..1f1ecb4c9e6d 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -295,7 +295,7 @@ for. Each module documents its respective events under 'xx_events.md'. cmd.Flags().Int(flags.FlagLimit, querytypes.DefaultLimit, "Query number of transactions results per page returned") cmd.Flags().String(flagQuery, "", "The transactions events query per Tendermint's query semantics") cmd.Flags().String(flagOrderBy, "", "The ordering semantics (asc|dsc)") - cmd.MarkFlagRequired(flagQuery) + _ = cmd.MarkFlagRequired(flagQuery) return cmd } From a96463f4c03bdb2f5ddfe8c4d49c10867ec09a2f Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 19:11:30 -0500 Subject: [PATCH 11/24] updates --- tests/e2e/auth/cli_test.go | 2 -- tests/e2e/auth/suite.go | 12 ++++++++---- x/auth/client/cli/suite_test.go | 12 ++++++++---- x/auth/tx/query.go | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/e2e/auth/cli_test.go b/tests/e2e/auth/cli_test.go index 44df46f1931f..45688f5f9121 100644 --- a/tests/e2e/auth/cli_test.go +++ b/tests/e2e/auth/cli_test.go @@ -7,9 +7,7 @@ import ( "testing" "cosmossdk.io/simapp" - "github.com/cosmos/cosmos-sdk/testutil/network" - "github.com/stretchr/testify/suite" ) diff --git a/tests/e2e/auth/suite.go b/tests/e2e/auth/suite.go index 3e912741ea6d..996cc8e16636 100644 --- a/tests/e2e/auth/suite.go +++ b/tests/e2e/auth/suite.go @@ -708,8 +708,10 @@ func (s *E2ETestSuite) TestCLIQueryTxsCmdByEvents() { { "fee event happy case", []string{ - fmt.Sprintf("--events=tx.fee=%s", - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf( + "--query=tx.fee='%s'", + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String(), + ), fmt.Sprintf("--%s=json", flags.FlagOutput), }, false, @@ -717,8 +719,10 @@ func (s *E2ETestSuite) TestCLIQueryTxsCmdByEvents() { { "no matching fee event", []string{ - fmt.Sprintf("--events=tx.fee=%s", - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(0))).String()), + fmt.Sprintf( + "--query=tx.fee='%s'", + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(0))).String(), + ), fmt.Sprintf("--%s=json", flags.FlagOutput), }, true, diff --git a/x/auth/client/cli/suite_test.go b/x/auth/client/cli/suite_test.go index 64e82d07d0f5..bffe7e273715 100644 --- a/x/auth/client/cli/suite_test.go +++ b/x/auth/client/cli/suite_test.go @@ -292,8 +292,10 @@ func (s *CLITestSuite) TestCLIQueryTxsCmdByEvents() { { "fee event happy case", []string{ - fmt.Sprintf("--events=tx.fee=%s", - sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(10))).String()), + fmt.Sprintf( + "--query=tx.fee='%s'", + sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(10))).String(), + ), fmt.Sprintf("--%s=json", flags.FlagOutput), }, "", @@ -301,8 +303,10 @@ func (s *CLITestSuite) TestCLIQueryTxsCmdByEvents() { { "no matching fee event", []string{ - fmt.Sprintf("--events=tx.fee=%s", - sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(0))).String()), + fmt.Sprintf( + "--query=tx.fee='%s'", + sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(0))).String(), + ), fmt.Sprintf("--%s=json", flags.FlagOutput), }, "", diff --git a/x/auth/tx/query.go b/x/auth/tx/query.go index 0251ef8f564c..86b4d395b7c1 100644 --- a/x/auth/tx/query.go +++ b/x/auth/tx/query.go @@ -44,7 +44,7 @@ func QueryTxsByEvents(clientCtx client.Context, page, limit int, query, orderBy resTxs, err := node.TxSearch(context.Background(), query, false, &page, &limit, orderBy) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to search for txs: %w", err) } resBlocks, err := getBlocksForTxResults(clientCtx, resTxs.Txs) From a933e224c47d98391b61604f3a1ddddc935f390f Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 25 Jan 2023 19:12:21 -0500 Subject: [PATCH 12/24] updates --- server/grpc/server_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/grpc/server_test.go b/server/grpc/server_test.go index e5d79ed69a81..ed6272b34fa1 100644 --- a/server/grpc/server_test.go +++ b/server/grpc/server_test.go @@ -159,7 +159,7 @@ func (s *IntegrationTestSuite) TestGRPCServer_GetTxsEvent() { _, err := txServiceClient.GetTxsEvent( context.Background(), &txtypes.GetTxsEventRequest{ - Events: []string{"message.action='send'"}, + Query: "message.action='send'", }, ) s.Require().NoError(err) From 76a2a0318b08e211dcc608726c590958f781c274 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 20 Feb 2023 12:25:34 +0100 Subject: [PATCH 13/24] fix merge --- x/auth/client/cli/query.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index fc4043df7ba8..d6c283a1b8e1 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -20,15 +20,15 @@ import ( ) const ( - FlagEvents = "events" // TODO: Remove when #14758 is merged - FlagQuery = "query" - FlagType = "type" - FlagOrderBy = "order_by" + flagEvents = "events" // TODO: Remove when #14758 is merged + flagQuery = "query" + flagType = "type" + flagOrderBy = "order_by" - TypeHash = "hash" - TypeAccSeq = "acc_seq" - TypeSig = "signature" - TypeHeight = "height" + typeHash = "hash" + typeAccSeq = "acc_seq" + typeSig = "signature" + typeHeight = "height" EventFormat = "{eventType}.{eventAttribute}={value}" ) @@ -317,8 +317,8 @@ $ %s query tx --%s=%s / $ %s query tx --%s=%s , `, version.AppName, - version.AppName, FlagType, TypeAccSeq, - version.AppName, FlagType, TypeSig)), + version.AppName, flagType, typeAccSeq, + version.AppName, flagType, typeSig)), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) @@ -326,7 +326,7 @@ $ %s query tx --%s=%s , return err } - typ, _ := cmd.Flags().GetString(FlagType) + typ, _ := cmd.Flags().GetString(flagType) switch typ { case typeHash: @@ -399,13 +399,13 @@ $ %s query tx --%s=%s , return clientCtx.PrintProto(txs.Txs[0]) default: - return fmt.Errorf("unknown --%s value %s", FlagType, typ) + return fmt.Errorf("unknown --%s value %s", flagType, typ) } }, } flags.AddQueryFlagsToCmd(cmd) - cmd.Flags().String(FlagType, TypeHash, fmt.Sprintf("The type to be used when querying tx, can be one of \"%s\", \"%s\", \"%s\"", TypeHash, TypeAccSeq, TypeSig)) + cmd.Flags().String(flagType, typeHash, fmt.Sprintf("The type to be used when querying tx, can be one of \"%s\", \"%s\", \"%s\"", typeHash, typeAccSeq, typeSig)) return cmd } From f938b7d1dfa7f6f1040c578cb3b664bfdeb482a4 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 20 Feb 2023 12:28:58 +0100 Subject: [PATCH 14/24] address comments --- proto/cosmos/tx/v1beta1/service.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto index 3c5e5940bdc7..798d1ad77150 100644 --- a/proto/cosmos/tx/v1beta1/service.proto +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -85,7 +85,7 @@ message GetTxsEventRequest { // events is the list of transaction event type. // Deprecated post v0.47.x: use query instead, which should contain a valid // events query. - repeated string events = 1; + repeated string events = 1 [deprecated = true]; // pagination defines a pagination for the request. // Deprecated post v0.46.x: use page and limit instead. @@ -103,6 +103,8 @@ message GetTxsEventRequest { // query defines the transaction event query that is proxied to Tendermint's // TxSearch RPC method. The query must be valid. + // + // Since Cosmos SDK 0.48 string query = 6; } From b88decbe0b2104057dfcfeeb948c7c1bdfdfd57c Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 20 Feb 2023 12:33:26 +0100 Subject: [PATCH 15/24] revert internal flags --- x/auth/client/cli/query.go | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index d6c283a1b8e1..5995a4c3d37b 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -20,15 +20,15 @@ import ( ) const ( - flagEvents = "events" // TODO: Remove when #14758 is merged - flagQuery = "query" - flagType = "type" - flagOrderBy = "order_by" + FlagEvents = "events" // TODO: Remove when #14758 is merged + FlagQuery = "query" + FlagType = "type" + FlagOrderBy = "order_by" - typeHash = "hash" - typeAccSeq = "acc_seq" - typeSig = "signature" - typeHeight = "height" + TypeHash = "hash" + TypeAccSeq = "acc_seq" + TypeSig = "signature" + TypeHeight = "height" EventFormat = "{eventType}.{eventAttribute}={value}" ) @@ -281,10 +281,10 @@ for. Each module documents its respective events under 'xx_events.md'. return err } - query, _ := cmd.Flags().GetString(flagQuery) + query, _ := cmd.Flags().GetString(FlagQuery) page, _ := cmd.Flags().GetInt(flags.FlagPage) limit, _ := cmd.Flags().GetInt(flags.FlagLimit) - orderBy, _ := cmd.Flags().GetString(flagOrderBy) + orderBy, _ := cmd.Flags().GetString(FlagOrderBy) txs, err := authtx.QueryTxsByEvents(clientCtx, page, limit, query, orderBy) if err != nil { @@ -298,9 +298,9 @@ for. Each module documents its respective events under 'xx_events.md'. flags.AddQueryFlagsToCmd(cmd) cmd.Flags().Int(flags.FlagPage, querytypes.DefaultPage, "Query a specific page of paginated results") cmd.Flags().Int(flags.FlagLimit, querytypes.DefaultLimit, "Query number of transactions results per page returned") - cmd.Flags().String(flagQuery, "", "The transactions events query per Tendermint's query semantics") - cmd.Flags().String(flagOrderBy, "", "The ordering semantics (asc|dsc)") - _ = cmd.MarkFlagRequired(flagQuery) + cmd.Flags().String(FlagQuery, "", "The transactions events query per Tendermint's query semantics") + cmd.Flags().String(FlagOrderBy, "", "The ordering semantics (asc|dsc)") + _ = cmd.MarkFlagRequired(FlagQuery) return cmd } @@ -317,8 +317,8 @@ $ %s query tx --%s=%s / $ %s query tx --%s=%s , `, version.AppName, - version.AppName, flagType, typeAccSeq, - version.AppName, flagType, typeSig)), + version.AppName, FlagType, TypeAccSeq, + version.AppName, FlagType, TypeSig)), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) @@ -326,10 +326,10 @@ $ %s query tx --%s=%s , return err } - typ, _ := cmd.Flags().GetString(flagType) + typ, _ := cmd.Flags().GetString(FlagType) switch typ { - case typeHash: + case TypeHash: if args[0] == "" { return fmt.Errorf("argument should be a tx hash") } @@ -346,7 +346,7 @@ $ %s query tx --%s=%s , return clientCtx.PrintProto(output) - case typeSig: + case TypeSig: sigParts, err := ParseSigArgs(args) if err != nil { return err @@ -375,7 +375,7 @@ $ %s query tx --%s=%s , return clientCtx.PrintProto(txs.Txs[0]) - case typeAccSeq: + case TypeAccSeq: if args[0] == "" { return fmt.Errorf("`acc_seq` type takes an argument '/'") } @@ -399,13 +399,13 @@ $ %s query tx --%s=%s , return clientCtx.PrintProto(txs.Txs[0]) default: - return fmt.Errorf("unknown --%s value %s", flagType, typ) + return fmt.Errorf("unknown --%s value %s", FlagType, typ) } }, } flags.AddQueryFlagsToCmd(cmd) - cmd.Flags().String(flagType, typeHash, fmt.Sprintf("The type to be used when querying tx, can be one of \"%s\", \"%s\", \"%s\"", typeHash, typeAccSeq, typeSig)) + cmd.Flags().String(FlagType, TypeHash, fmt.Sprintf("The type to be used when querying tx, can be one of \"%s\", \"%s\", \"%s\"", TypeHash, TypeAccSeq, TypeSig)) return cmd } From 5ff6d30c6ea623fc025dfe931b92ba16fec90136 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 20 Feb 2023 13:03:37 +0100 Subject: [PATCH 16/24] delete extra lines --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 069ec9a734bc..1703ff4b4e74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -188,8 +188,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#14847](https://github.com/cosmos/cosmos-sdk/pull/14847) App and ModuleManager methods `InitGenesis`, `ExportGenesis`, `BeginBlock` and `EndBlock` now also return an error. * (simulation) [#14728](https://github.com/cosmos/cosmos-sdk/pull/14728) Rename the `ParamChanges` field to `LegacyParamChange` and `Contents` to `LegacyProposalContents` in `simulation.SimulationState`. Additionally it adds a `ProposalMsgs` field to `simulation.SimulationState`. * (x/upgrade) [#14764](https://github.com/cosmos/cosmos-sdk/pull/14764) The `x/upgrade` module is extracted to have a separate go.mod file which allows it to be a standalone module. - - * (x/gov) [#14782](https://github.com/cosmos/cosmos-sdk/pull/14782) Move the `metadata` argument in `govv1.NewProposal` alongside `title` and `summary`. * (store) [#14746](https://github.com/cosmos/cosmos-sdk/pull/14746) Extract Store in its own go.mod and rename the package to `cosmossdk.io/store`. * (simulation) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove the `MsgType` field from `simulation.OperationInput` struct. From eb4de629cfae9935c4c5b5b0574422fa07d27d94 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 21 Feb 2023 15:37:31 +0100 Subject: [PATCH 17/24] remove unneeded testcase --- tests/e2e/tx/service_test.go | 44 ------------------------------------ 1 file changed, 44 deletions(-) diff --git a/tests/e2e/tx/service_test.go b/tests/e2e/tx/service_test.go index c7767ac089a9..9d1896253a40 100644 --- a/tests/e2e/tx/service_test.go +++ b/tests/e2e/tx/service_test.go @@ -7,7 +7,6 @@ import ( "strings" "testing" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" errorsmod "cosmossdk.io/errors" @@ -148,49 +147,6 @@ func (s *E2ETestSuite) TestQueryBySig() { s.Require().ErrorContains(err, "invalid event;") } -func TestEventRegex(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - event string - match bool - }{ - { - name: "valid: with quotes", - event: "tx.message='something'", - match: true, - }, - { - name: "valid: with underscores", - event: "claim_reward.message_action='something'", - match: true, - }, - { - name: "valid: no quotes", - event: "tx.message=something", - match: true, - }, - { - name: "invalid: too many separators", - event: "tx.message.foo='bar'", - match: false, - }, - { - name: "valid: symbols ok", - event: "tx.signature='foobar/baz123=='", - match: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - match := authtx.EventRegex.Match([]byte(tc.event)) - require.Equal(t, tc.match, match) - }) - } -} - func (s E2ETestSuite) TestSimulateTx_GRPC() { val := s.network.Validators[0] txBuilder := s.mkTxBuilder() From 1b7d3b9fe744ec6701280b29358057c867432265 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 23 Feb 2023 12:49:10 +0100 Subject: [PATCH 18/24] surface issue by remove cometbft replace --- tests/go.mod | 2 -- tests/go.sum | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/go.mod b/tests/go.mod index 138f07988706..e9587c9a4269 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -195,8 +195,6 @@ replace ( cosmossdk.io/x/feegrant => ../x/feegrant cosmossdk.io/x/nft => ../x/nft cosmossdk.io/x/upgrade => ../x/upgrade - // This can be deleted after the CometBFT PR is merged - github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d ) // Below are the long-lived replace for tests. diff --git a/tests/go.sum b/tests/go.sum index 3de0a73f9d93..215aa34a2215 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -323,8 +323,8 @@ github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5w github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d h1:akhMrKe9V6+f+K8Brq3Cx+I2kRIizVsnU6+frARVTzo= -github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d/go.mod h1:EZUXFIzOBV/rscOektBL3X4FI5zHpu7tQMNNMwzv4ac= +github.com/cometbft/cometbft v0.37.0-alpha.3 h1:74F+cMr4pd1a2lFn/h4TxXmO8VWi3A2dxyoMcjlMWuQ= +github.com/cometbft/cometbft v0.37.0-alpha.3/go.mod h1:dUGbIGYoLM11xUruTTJY4Xp9FHh6Nfu3Nots8/+UNSo= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= From 3a6dc4d66a0ba910bf98cd560b1bdb723c45b1e4 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 23 Feb 2023 13:43:52 -0500 Subject: [PATCH 19/24] updates --- tests/e2e/tx/service_test.go | 48 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/tests/e2e/tx/service_test.go b/tests/e2e/tx/service_test.go index f83e83fb9db7..b940d64f0657 100644 --- a/tests/e2e/tx/service_test.go +++ b/tests/e2e/tx/service_test.go @@ -12,6 +12,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" clienttx "github.com/cosmos/cosmos-sdk/client/tx" @@ -135,7 +136,7 @@ func (s *E2ETestSuite) TestQueryBySig() { b64Sig := base64.StdEncoding.EncodeToString(sig.Signature) sigFormatted := fmt.Sprintf("%s.%s='%s'", sdk.EventTypeTx, sdk.AttributeKeySignature, b64Sig) res, err := s.queryClient.GetTxsEvent(context.Background(), &tx.GetTxsEventRequest{ - Events: []string{sigFormatted}, + Query: sigFormatted, OrderBy: 0, Page: 0, Limit: 10, @@ -146,7 +147,7 @@ func (s *E2ETestSuite) TestQueryBySig() { s.Require().Equal(res.Txs[0].Signatures[0], sig.Signature) // bad format should error - _, err = s.queryClient.GetTxsEvent(context.Background(), &tx.GetTxsEventRequest{Events: []string{"tx.foo.bar='baz'"}}) + _, err = s.queryClient.GetTxsEvent(context.Background(), &tx.GetTxsEventRequest{Query: "tx.foo.bar='baz'"}) s.Require().ErrorContains(err, "invalid event;") } @@ -250,48 +251,62 @@ func (s E2ETestSuite) TestGetTxEvents_GRPC() { { "nil request", nil, - true, "request cannot be nil", 0, + true, + "request cannot be nil", + 0, }, { "empty request", &tx.GetTxsEventRequest{}, - true, "must declare at least one event to search", 0, + true, + "query cannot be empty", + 0, }, { "request with dummy event", - &tx.GetTxsEventRequest{Events: []string{"foobar"}}, - true, "event foobar should be of the format: {eventType}.{eventAttribute}={value}", 0, + &tx.GetTxsEventRequest{Query: "foobar"}, + true, + "failed to search for txs", + 0, }, { "request with order-by", &tx.GetTxsEventRequest{ - Events: []string{bankMsgSendEventAction}, + Query: bankMsgSendEventAction, OrderBy: tx.OrderBy_ORDER_BY_ASC, }, - false, "", 3, + false, + "", + 3, }, { "without pagination", &tx.GetTxsEventRequest{ - Events: []string{bankMsgSendEventAction}, + Query: bankMsgSendEventAction, }, - false, "", 3, + false, + "", + 3, }, { "with pagination", &tx.GetTxsEventRequest{ - Events: []string{bankMsgSendEventAction}, - Page: 2, - Limit: 2, + Query: bankMsgSendEventAction, + Page: 2, + Limit: 2, }, - false, "", 1, + false, + "", + 1, }, { "with multi events", &tx.GetTxsEventRequest{ - Events: []string{bankMsgSendEventAction, "message.module='bank'"}, + Query: fmt.Sprintf("%s AND message.module='bank'", bankMsgSendEventAction), }, - false, "", 3, + false, + "", + 3, }, } for _, tc := range testCases { @@ -306,6 +321,7 @@ func (s E2ETestSuite) TestGetTxEvents_GRPC() { s.Require().GreaterOrEqual(len(grpcRes.Txs), 1) s.Require().Equal("foobar", grpcRes.Txs[0].Body.Memo) s.Require().Equal(len(grpcRes.Txs), tc.expLen) + // Make sure fields are populated. // ref: https://github.com/cosmos/cosmos-sdk/issues/8680 // ref: https://github.com/cosmos/cosmos-sdk/issues/8681 From bf691059a20c07caaf7a6a68ed4e84259d130be6 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 23 Feb 2023 14:52:07 -0500 Subject: [PATCH 20/24] updates --- go.mod | 3 +++ go.sum | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index fe27932eb503..3ea97181dbb9 100644 --- a/go.mod +++ b/go.mod @@ -161,6 +161,9 @@ require ( replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + + // TODO: This can be deleted after the CometBFT PR is merged. + github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 diff --git a/go.sum b/go.sum index 853c6179a51d..90bb2a97b626 100644 --- a/go.sum +++ b/go.sum @@ -164,8 +164,8 @@ github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5w github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.37.0-alpha.3 h1:74F+cMr4pd1a2lFn/h4TxXmO8VWi3A2dxyoMcjlMWuQ= -github.com/cometbft/cometbft v0.37.0-alpha.3/go.mod h1:dUGbIGYoLM11xUruTTJY4Xp9FHh6Nfu3Nots8/+UNSo= +github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d h1:akhMrKe9V6+f+K8Brq3Cx+I2kRIizVsnU6+frARVTzo= +github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d/go.mod h1:EZUXFIzOBV/rscOektBL3X4FI5zHpu7tQMNNMwzv4ac= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= From afbaf98c7dc99dc539f189ca8508bb86bed50112 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Feb 2023 15:31:08 +0100 Subject: [PATCH 21/24] updates --- go.mod | 3 --- go.sum | 4 ++-- tests/go.mod | 2 ++ tests/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 3ea97181dbb9..fe27932eb503 100644 --- a/go.mod +++ b/go.mod @@ -161,9 +161,6 @@ require ( replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - - // TODO: This can be deleted after the CometBFT PR is merged. - github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 diff --git a/go.sum b/go.sum index 90bb2a97b626..853c6179a51d 100644 --- a/go.sum +++ b/go.sum @@ -164,8 +164,8 @@ github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5w github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d h1:akhMrKe9V6+f+K8Brq3Cx+I2kRIizVsnU6+frARVTzo= -github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d/go.mod h1:EZUXFIzOBV/rscOektBL3X4FI5zHpu7tQMNNMwzv4ac= +github.com/cometbft/cometbft v0.37.0-alpha.3 h1:74F+cMr4pd1a2lFn/h4TxXmO8VWi3A2dxyoMcjlMWuQ= +github.com/cometbft/cometbft v0.37.0-alpha.3/go.mod h1:dUGbIGYoLM11xUruTTJY4Xp9FHh6Nfu3Nots8/+UNSo= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= diff --git a/tests/go.mod b/tests/go.mod index 88a4e2ecde7b..fdbfb42a6b8b 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -198,6 +198,8 @@ replace ( cosmossdk.io/x/nft => ../x/nft cosmossdk.io/x/tx => ../x/tx cosmossdk.io/x/upgrade => ../x/upgrade + // TODO: This can be deleted after the CometBFT PR is merged. + github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d ) // Below are the long-lived replace for tests. diff --git a/tests/go.sum b/tests/go.sum index 90f6ab1b0001..fbd36b0d97a5 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -322,8 +322,8 @@ github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5w github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= -github.com/cometbft/cometbft v0.37.0-alpha.3 h1:74F+cMr4pd1a2lFn/h4TxXmO8VWi3A2dxyoMcjlMWuQ= -github.com/cometbft/cometbft v0.37.0-alpha.3/go.mod h1:dUGbIGYoLM11xUruTTJY4Xp9FHh6Nfu3Nots8/+UNSo= +github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d h1:akhMrKe9V6+f+K8Brq3Cx+I2kRIizVsnU6+frARVTzo= +github.com/cometbft/cometbft v0.0.0-20230203130311-387422ac220d/go.mod h1:EZUXFIzOBV/rscOektBL3X4FI5zHpu7tQMNNMwzv4ac= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= From 4187bafaeea54223d5089e325c9e6330a24ae100 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Feb 2023 16:21:47 +0100 Subject: [PATCH 22/24] updates --- tests/e2e/tx/service_test.go | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/tests/e2e/tx/service_test.go b/tests/e2e/tx/service_test.go index b940d64f0657..3e68be8f4435 100644 --- a/tests/e2e/tx/service_test.go +++ b/tests/e2e/tx/service_test.go @@ -145,10 +145,6 @@ func (s *E2ETestSuite) TestQueryBySig() { s.Require().Len(res.Txs, 1) s.Require().Len(res.Txs[0].Signatures, 1) s.Require().Equal(res.Txs[0].Signatures[0], sig.Signature) - - // bad format should error - _, err = s.queryClient.GetTxsEvent(context.Background(), &tx.GetTxsEventRequest{Query: "tx.foo.bar='baz'"}) - s.Require().ErrorContains(err, "invalid event;") } func (s E2ETestSuite) TestSimulateTx_GRPC() { @@ -345,47 +341,47 @@ func (s E2ETestSuite) TestGetTxEvents_GRPCGateway() { "empty params", fmt.Sprintf("%s/cosmos/tx/v1beta1/txs", val.APIAddress), true, - "must declare at least one event to search", 0, + "query cannot be empty", 0, }, { "without pagination", - fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?events=%s", val.APIAddress, bankMsgSendEventAction), + fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s", val.APIAddress, bankMsgSendEventAction), false, "", 3, }, { "with pagination", - fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?events=%s&page=%d&limit=%d", val.APIAddress, bankMsgSendEventAction, 2, 2), + fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&page=%d&limit=%d", val.APIAddress, bankMsgSendEventAction, 2, 1), false, "", 1, }, { "valid request: order by asc", - fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?events=%s&events=%s&order_by=ORDER_BY_ASC", val.APIAddress, bankMsgSendEventAction, "message.module='bank'"), + fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s&order_by=ORDER_BY_ASC", val.APIAddress, bankMsgSendEventAction, "message.module='bank'"), false, "", 3, }, { "valid request: order by desc", - fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?events=%s&events=%s&order_by=ORDER_BY_DESC", val.APIAddress, bankMsgSendEventAction, "message.module='bank'"), + fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s&order_by=ORDER_BY_DESC", val.APIAddress, bankMsgSendEventAction, "message.module='bank'"), false, "", 3, }, { "invalid request: invalid order by", - fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?events=%s&events=%s&order_by=invalid_order", val.APIAddress, bankMsgSendEventAction, "message.module='bank'"), + fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s&order_by=invalid_order", val.APIAddress, bankMsgSendEventAction, "message.module='bank'"), true, "is not a valid tx.OrderBy", 0, }, { "expect pass with multiple-events", - fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?events=%s&events=%s", val.APIAddress, bankMsgSendEventAction, "message.module='bank'"), + fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s", val.APIAddress, bankMsgSendEventAction, "message.module='bank'"), false, "", 3, }, { "expect pass with escape event", - fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?events=%s", val.APIAddress, "message.action%3D'/cosmos.bank.v1beta1.MsgSend'"), + fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s", val.APIAddress, "message.action%3D'/cosmos.bank.v1beta1.MsgSend'"), false, "", 3, }, @@ -399,11 +395,11 @@ func (s E2ETestSuite) TestGetTxEvents_GRPCGateway() { } else { var result tx.GetTxsEventResponse err = val.ClientCtx.Codec.UnmarshalJSON(res, &result) - s.Require().NoError(err) + s.Require().NoError(err, "failed to unmarshal JSON: %s", res) s.Require().GreaterOrEqual(len(result.Txs), 1) s.Require().Equal("foobar", result.Txs[0].Body.Memo) s.Require().NotZero(result.TxResponses[0].Height) - s.Require().Equal(len(result.Txs), tc.expLen) + s.Require().Equal(tc.expLen, int(result.Total)) } }) } From 4180ed12968029b9724f7385d4bda48fe520cc1a Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Feb 2023 16:46:15 +0100 Subject: [PATCH 23/24] same pagination --- tests/e2e/tx/service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/tx/service_test.go b/tests/e2e/tx/service_test.go index 3e68be8f4435..7f4671c30a44 100644 --- a/tests/e2e/tx/service_test.go +++ b/tests/e2e/tx/service_test.go @@ -351,7 +351,7 @@ func (s E2ETestSuite) TestGetTxEvents_GRPCGateway() { }, { "with pagination", - fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&page=%d&limit=%d", val.APIAddress, bankMsgSendEventAction, 2, 1), + fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&page=%d&limit=%d", val.APIAddress, bankMsgSendEventAction, 2, 2), false, "", 1, }, From 7cdec415025ed6b345d4a13c9b83b003479e79ff Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Feb 2023 16:47:24 +0100 Subject: [PATCH 24/24] updates --- tests/e2e/tx/service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/tx/service_test.go b/tests/e2e/tx/service_test.go index 7f4671c30a44..b72ba033210f 100644 --- a/tests/e2e/tx/service_test.go +++ b/tests/e2e/tx/service_test.go @@ -399,7 +399,7 @@ func (s E2ETestSuite) TestGetTxEvents_GRPCGateway() { s.Require().GreaterOrEqual(len(result.Txs), 1) s.Require().Equal("foobar", result.Txs[0].Body.Memo) s.Require().NotZero(result.TxResponses[0].Height) - s.Require().Equal(tc.expLen, int(result.Total)) + s.Require().Equal(tc.expLen, len(result.Txs)) } }) }