diff --git a/CHANGELOG.md b/CHANGELOG.md index 237bebf0944f..716421873780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) Added ability to query blocks by events with queries directly passed to Tendermint, which will allow for full query operator support, e.g. `>`. * [#14897](https://github.com/cosmos/cosmos-sdk/pull/14897) Migrate the Cosmos SDK to CometBFT. * (x/gov) [#14720](https://github.com/cosmos/cosmos-sdk/pull/14720) Upstream expedited proposals from Osmosis. * (x/auth) [#14650](https://github.com/cosmos/cosmos-sdk/pull/14650) Add Textual SignModeHandler. It is however **NOT** enabled by default, and should only be used for **TESTING** purposes until `SIGN_MODE_TEXTUAL` is fully released. @@ -78,6 +79,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) Added ability to query blocks by either height/hash `simd q block --type=height|hash `. * (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. * (x/evidence) [#14757](https://github.com/cosmos/cosmos-sdk/pull/14757) Evidence messages do not need to implement a `.Type()` anymore. * (x/auth/tx) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove `.Type()` and `Route()` methods from all msgs and `legacytx.LegacyMsg` interface. @@ -258,6 +260,7 @@ extension interfaces. `module.Manager.Modules` is now of type `map[string]interf ### CLI Breaking Changes +* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) `simd q block ` is removed as it just output json. The new command allows either height/hash and is `simd q block --type=height|hash `. * (x/gov) [#14880](https://github.com/cosmos/cosmos-sdk/pull/14880) Remove `simd tx gov submit-legacy-proposal cancel-software-upgrade` and `software-upgrade` commands. These commands are now in the `x/upgrade` module and using gov v1. Use `tx upgrade software-upgrade` instead. * (grpc-web) [#14652](https://github.com/cosmos/cosmos-sdk/pull/14652) Remove `grpc-web.address` flag. * (client) [#14342](https://github.com/cosmos/cosmos-sdk/pull/14342) `simd config` command is now a sub-command. Use `simd config --help` to learn more. diff --git a/api/cosmos/base/abci/v1beta1/abci.pulsar.go b/api/cosmos/base/abci/v1beta1/abci.pulsar.go index 6d3253676da1..9b5ea1a430a8 100644 --- a/api/cosmos/base/abci/v1beta1/abci.pulsar.go +++ b/api/cosmos/base/abci/v1beta1/abci.pulsar.go @@ -3,6 +3,7 @@ package abciv1beta1 import ( abci "cosmossdk.io/api/tendermint/abci" + types "cosmossdk.io/api/tendermint/types" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" @@ -6530,6 +6531,740 @@ func (x *fastReflection_SearchTxsResult) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_SearchBlocksResult_6_list)(nil) + +type _SearchBlocksResult_6_list struct { + list *[]*types.Block +} + +func (x *_SearchBlocksResult_6_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_SearchBlocksResult_6_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_SearchBlocksResult_6_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*types.Block) + (*x.list)[i] = concreteValue +} + +func (x *_SearchBlocksResult_6_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*types.Block) + *x.list = append(*x.list, concreteValue) +} + +func (x *_SearchBlocksResult_6_list) AppendMutable() protoreflect.Value { + v := new(types.Block) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SearchBlocksResult_6_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_SearchBlocksResult_6_list) NewElement() protoreflect.Value { + v := new(types.Block) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_SearchBlocksResult_6_list) IsValid() bool { + return x.list != nil +} + +var ( + md_SearchBlocksResult protoreflect.MessageDescriptor + fd_SearchBlocksResult_total_count protoreflect.FieldDescriptor + fd_SearchBlocksResult_count protoreflect.FieldDescriptor + fd_SearchBlocksResult_page_number protoreflect.FieldDescriptor + fd_SearchBlocksResult_page_total protoreflect.FieldDescriptor + fd_SearchBlocksResult_limit protoreflect.FieldDescriptor + fd_SearchBlocksResult_blocks protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_abci_v1beta1_abci_proto_init() + md_SearchBlocksResult = File_cosmos_base_abci_v1beta1_abci_proto.Messages().ByName("SearchBlocksResult") + fd_SearchBlocksResult_total_count = md_SearchBlocksResult.Fields().ByName("total_count") + fd_SearchBlocksResult_count = md_SearchBlocksResult.Fields().ByName("count") + fd_SearchBlocksResult_page_number = md_SearchBlocksResult.Fields().ByName("page_number") + fd_SearchBlocksResult_page_total = md_SearchBlocksResult.Fields().ByName("page_total") + fd_SearchBlocksResult_limit = md_SearchBlocksResult.Fields().ByName("limit") + fd_SearchBlocksResult_blocks = md_SearchBlocksResult.Fields().ByName("blocks") +} + +var _ protoreflect.Message = (*fastReflection_SearchBlocksResult)(nil) + +type fastReflection_SearchBlocksResult SearchBlocksResult + +func (x *SearchBlocksResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_SearchBlocksResult)(x) +} + +func (x *SearchBlocksResult) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_abci_v1beta1_abci_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_SearchBlocksResult_messageType fastReflection_SearchBlocksResult_messageType +var _ protoreflect.MessageType = fastReflection_SearchBlocksResult_messageType{} + +type fastReflection_SearchBlocksResult_messageType struct{} + +func (x fastReflection_SearchBlocksResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_SearchBlocksResult)(nil) +} +func (x fastReflection_SearchBlocksResult_messageType) New() protoreflect.Message { + return new(fastReflection_SearchBlocksResult) +} +func (x fastReflection_SearchBlocksResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SearchBlocksResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SearchBlocksResult) Descriptor() protoreflect.MessageDescriptor { + return md_SearchBlocksResult +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_SearchBlocksResult) Type() protoreflect.MessageType { + return _fastReflection_SearchBlocksResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SearchBlocksResult) New() protoreflect.Message { + return new(fastReflection_SearchBlocksResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SearchBlocksResult) Interface() protoreflect.ProtoMessage { + return (*SearchBlocksResult)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_SearchBlocksResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.TotalCount != int64(0) { + value := protoreflect.ValueOfInt64(x.TotalCount) + if !f(fd_SearchBlocksResult_total_count, value) { + return + } + } + if x.Count != int64(0) { + value := protoreflect.ValueOfInt64(x.Count) + if !f(fd_SearchBlocksResult_count, value) { + return + } + } + if x.PageNumber != int64(0) { + value := protoreflect.ValueOfInt64(x.PageNumber) + if !f(fd_SearchBlocksResult_page_number, value) { + return + } + } + if x.PageTotal != int64(0) { + value := protoreflect.ValueOfInt64(x.PageTotal) + if !f(fd_SearchBlocksResult_page_total, value) { + return + } + } + if x.Limit != int64(0) { + value := protoreflect.ValueOfInt64(x.Limit) + if !f(fd_SearchBlocksResult_limit, value) { + return + } + } + if len(x.Blocks) != 0 { + value := protoreflect.ValueOfList(&_SearchBlocksResult_6_list{list: &x.Blocks}) + if !f(fd_SearchBlocksResult_blocks, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_SearchBlocksResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.abci.v1beta1.SearchBlocksResult.total_count": + return x.TotalCount != int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.count": + return x.Count != int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_number": + return x.PageNumber != int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_total": + return x.PageTotal != int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.limit": + return x.Limit != int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.blocks": + return len(x.Blocks) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.abci.v1beta1.SearchBlocksResult")) + } + panic(fmt.Errorf("message cosmos.base.abci.v1beta1.SearchBlocksResult does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SearchBlocksResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.abci.v1beta1.SearchBlocksResult.total_count": + x.TotalCount = int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.count": + x.Count = int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_number": + x.PageNumber = int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_total": + x.PageTotal = int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.limit": + x.Limit = int64(0) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.blocks": + x.Blocks = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.abci.v1beta1.SearchBlocksResult")) + } + panic(fmt.Errorf("message cosmos.base.abci.v1beta1.SearchBlocksResult does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_SearchBlocksResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.abci.v1beta1.SearchBlocksResult.total_count": + value := x.TotalCount + return protoreflect.ValueOfInt64(value) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.count": + value := x.Count + return protoreflect.ValueOfInt64(value) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_number": + value := x.PageNumber + return protoreflect.ValueOfInt64(value) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_total": + value := x.PageTotal + return protoreflect.ValueOfInt64(value) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.limit": + value := x.Limit + return protoreflect.ValueOfInt64(value) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.blocks": + if len(x.Blocks) == 0 { + return protoreflect.ValueOfList(&_SearchBlocksResult_6_list{}) + } + listValue := &_SearchBlocksResult_6_list{list: &x.Blocks} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.abci.v1beta1.SearchBlocksResult")) + } + panic(fmt.Errorf("message cosmos.base.abci.v1beta1.SearchBlocksResult does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SearchBlocksResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.abci.v1beta1.SearchBlocksResult.total_count": + x.TotalCount = value.Int() + case "cosmos.base.abci.v1beta1.SearchBlocksResult.count": + x.Count = value.Int() + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_number": + x.PageNumber = value.Int() + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_total": + x.PageTotal = value.Int() + case "cosmos.base.abci.v1beta1.SearchBlocksResult.limit": + x.Limit = value.Int() + case "cosmos.base.abci.v1beta1.SearchBlocksResult.blocks": + lv := value.List() + clv := lv.(*_SearchBlocksResult_6_list) + x.Blocks = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.abci.v1beta1.SearchBlocksResult")) + } + panic(fmt.Errorf("message cosmos.base.abci.v1beta1.SearchBlocksResult does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SearchBlocksResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.abci.v1beta1.SearchBlocksResult.blocks": + if x.Blocks == nil { + x.Blocks = []*types.Block{} + } + value := &_SearchBlocksResult_6_list{list: &x.Blocks} + return protoreflect.ValueOfList(value) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.total_count": + panic(fmt.Errorf("field total_count of message cosmos.base.abci.v1beta1.SearchBlocksResult is not mutable")) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.count": + panic(fmt.Errorf("field count of message cosmos.base.abci.v1beta1.SearchBlocksResult is not mutable")) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_number": + panic(fmt.Errorf("field page_number of message cosmos.base.abci.v1beta1.SearchBlocksResult is not mutable")) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_total": + panic(fmt.Errorf("field page_total of message cosmos.base.abci.v1beta1.SearchBlocksResult is not mutable")) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.limit": + panic(fmt.Errorf("field limit of message cosmos.base.abci.v1beta1.SearchBlocksResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.abci.v1beta1.SearchBlocksResult")) + } + panic(fmt.Errorf("message cosmos.base.abci.v1beta1.SearchBlocksResult does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_SearchBlocksResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.abci.v1beta1.SearchBlocksResult.total_count": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.count": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_number": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.page_total": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.limit": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.base.abci.v1beta1.SearchBlocksResult.blocks": + list := []*types.Block{} + return protoreflect.ValueOfList(&_SearchBlocksResult_6_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.abci.v1beta1.SearchBlocksResult")) + } + panic(fmt.Errorf("message cosmos.base.abci.v1beta1.SearchBlocksResult does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_SearchBlocksResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.abci.v1beta1.SearchBlocksResult", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_SearchBlocksResult) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SearchBlocksResult) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_SearchBlocksResult) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_SearchBlocksResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SearchBlocksResult) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.TotalCount != 0 { + n += 1 + runtime.Sov(uint64(x.TotalCount)) + } + if x.Count != 0 { + n += 1 + runtime.Sov(uint64(x.Count)) + } + if x.PageNumber != 0 { + n += 1 + runtime.Sov(uint64(x.PageNumber)) + } + if x.PageTotal != 0 { + n += 1 + runtime.Sov(uint64(x.PageTotal)) + } + if x.Limit != 0 { + n += 1 + runtime.Sov(uint64(x.Limit)) + } + if len(x.Blocks) > 0 { + for _, e := range x.Blocks { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*SearchBlocksResult) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Blocks) > 0 { + for iNdEx := len(x.Blocks) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Blocks[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x32 + } + } + if x.Limit != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Limit)) + i-- + dAtA[i] = 0x28 + } + if x.PageTotal != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.PageTotal)) + i-- + dAtA[i] = 0x20 + } + if x.PageNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.PageNumber)) + i-- + dAtA[i] = 0x18 + } + if x.Count != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Count)) + i-- + dAtA[i] = 0x10 + } + if x.TotalCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TotalCount)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*SearchBlocksResult) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SearchBlocksResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SearchBlocksResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TotalCount", wireType) + } + x.TotalCount = 0 + 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++ + x.TotalCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + x.Count = 0 + 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++ + x.Count |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PageNumber", wireType) + } + x.PageNumber = 0 + 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++ + x.PageNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PageTotal", wireType) + } + x.PageTotal = 0 + 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++ + x.PageTotal |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + x.Limit = 0 + 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++ + x.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var msglen int + 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++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + 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.Blocks = append(x.Blocks, &types.Block{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Blocks[len(x.Blocks)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -7186,6 +7921,88 @@ func (x *SearchTxsResult) GetTxs() []*TxResponse { return nil } +// SearchBlocksResult defines a structure for querying blocks pageable +type SearchBlocksResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Count of all blocks + TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + // Count of blocks in current page + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + // Index of current page, start from 1 + PageNumber int64 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + // Count of total pages + PageTotal int64 `protobuf:"varint,4,opt,name=page_total,json=pageTotal,proto3" json:"page_total,omitempty"` + // Max count blocks per page + Limit int64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + // List of blocks in current page + Blocks []*types.Block `protobuf:"bytes,6,rep,name=blocks,proto3" json:"blocks,omitempty"` +} + +func (x *SearchBlocksResult) Reset() { + *x = SearchBlocksResult{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_abci_v1beta1_abci_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchBlocksResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchBlocksResult) ProtoMessage() {} + +// Deprecated: Use SearchBlocksResult.ProtoReflect.Descriptor instead. +func (*SearchBlocksResult) Descriptor() ([]byte, []int) { + return file_cosmos_base_abci_v1beta1_abci_proto_rawDescGZIP(), []int{10} +} + +func (x *SearchBlocksResult) GetTotalCount() int64 { + if x != nil { + return x.TotalCount + } + return 0 +} + +func (x *SearchBlocksResult) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *SearchBlocksResult) GetPageNumber() int64 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *SearchBlocksResult) GetPageTotal() int64 { + if x != nil { + return x.PageTotal + } + return 0 +} + +func (x *SearchBlocksResult) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *SearchBlocksResult) GetBlocks() []*types.Block { + if x != nil { + return x.Blocks + } + return nil +} + var File_cosmos_base_abci_v1beta1_abci_proto protoreflect.FileDescriptor var file_cosmos_base_abci_v1beta1_abci_proto_rawDesc = []byte{ @@ -7196,125 +8013,141 @@ var file_cosmos_base_abci_v1beta1_abci_proto_rawDesc = []byte{ 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x03, - 0x0a, 0x0a, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x22, 0x0a, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xe2, 0xde, 0x1f, 0x06, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, - 0x52, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x17, - 0x0a, 0x07, 0x72, 0x61, 0x77, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x72, 0x61, 0x77, 0x4c, 0x6f, 0x67, 0x12, 0x55, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 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, 0x41, 0x42, 0x43, 0x49, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x67, 0x42, - 0x17, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x0f, 0x41, 0x42, 0x43, 0x49, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x12, - 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, - 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x67, 0x61, 0x73, 0x57, 0x61, 0x6e, 0x74, 0x65, - 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x24, 0x0a, 0x02, - 0x74, 0x78, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x02, - 0x74, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x34, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, - 0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xa9, 0x01, 0x0a, - 0x0e, 0x41, 0x42, 0x43, 0x49, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x67, 0x12, - 0x2a, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x08, 0x6d, 0x73, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6c, - 0x6f, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x53, 0x0a, - 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 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, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x42, 0x14, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x0c, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x72, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x61, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x23, 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, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x33, 0x0a, 0x09, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x43, 0x0a, 0x07, 0x47, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, - 0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x09, 0x67, 0x61, 0x73, 0x57, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, - 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, - 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x12, 0x16, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x02, 0x18, 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x34, 0x0a, 0x06, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0c, - 0x6d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x3a, 0x04, 0x88, 0xa0, - 0x1f, 0x00, 0x22, 0x96, 0x01, 0x0a, 0x12, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x67, 0x61, 0x73, - 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, + 0x74, 0x6f, 0x1a, 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, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x03, 0x0a, 0x0a, + 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x22, 0x0a, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0a, 0xe2, 0xde, 0x1f, 0x06, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x52, 0x06, + 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x17, 0x0a, 0x07, + 0x72, 0x61, 0x77, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, + 0x61, 0x77, 0x4c, 0x6f, 0x67, 0x12, 0x55, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x28, 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, 0x41, + 0x42, 0x43, 0x49, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x67, 0x42, 0x17, 0xc8, + 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x0f, 0x41, 0x42, 0x43, 0x49, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, + 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x67, 0x61, 0x73, 0x57, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x24, 0x0a, 0x02, 0x74, 0x78, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x02, 0x74, 0x78, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, + 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x41, + 0x42, 0x43, 0x49, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x2a, 0x0a, + 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x08, 0x6d, 0x73, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x53, 0x0a, 0x06, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 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, 0x42, 0x08, - 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 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, 0x40, 0x0a, 0x07, 0x4d, - 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x06, 0x18, 0x01, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x87, 0x01, - 0x0a, 0x09, 0x54, 0x78, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x42, 0x14, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x0c, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x72, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 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, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x33, 0x0a, 0x09, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x43, 0x0a, 0x07, 0x47, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, + 0x73, 0x5f, 0x77, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x67, 0x61, 0x73, 0x57, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, + 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, + 0x55, 0x73, 0x65, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x16, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x02, 0x18, + 0x01, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x34, 0x0a, 0x06, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x39, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0c, 0x6d, 0x73, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, + 0x22, 0x96, 0x01, 0x0a, 0x12, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 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, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x42, 0x02, 0x18, 0x01, - 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x41, 0x6e, 0x79, 0x52, 0x0c, 0x6d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x61, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x08, 0xc8, 0xde, + 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 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, 0x40, 0x0a, 0x07, 0x4d, 0x73, 0x67, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x3a, 0x06, 0x18, 0x01, 0x80, 0xdc, 0x20, 0x01, 0x22, 0x87, 0x01, 0x0a, 0x09, + 0x54, 0x78, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x03, 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, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x0c, 0x6d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x3a, + 0x04, 0x80, 0xdc, 0x20, 0x01, 0x22, 0xdc, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x06, 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, 0x03, 0x74, 0x78, 0x73, 0x3a, 0x04, + 0x80, 0xdc, 0x20, 0x01, 0x22, 0xd8, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x74, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x18, 0x06, 0x20, 0x03, 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, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x42, + 0xe7, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 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, 0x03, 0x74, 0x78, 0x73, - 0x3a, 0x04, 0x80, 0xdc, 0x20, 0x01, 0x42, 0xe7, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 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, 0x42, 0x09, 0x41, 0x62, 0x63, 0x69, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, - 0x73, 0x65, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, - 0x61, 0x62, 0x63, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, - 0x41, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, - 0x41, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x41, - 0x62, 0x63, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xd8, 0xe1, 0x1e, 0x00, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0x09, 0x41, 0x62, 0x63, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x61, 0x62, 0x63, 0x69, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x62, 0x63, 0x69, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x41, 0xaa, 0x02, 0x18, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, 0x41, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, + 0x61, 0x73, 0x65, 0x5c, 0x41, 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x41, + 0x62, 0x63, 0x69, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, 0x41, 0x62, 0x63, 0x69, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xd8, 0xe1, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -7329,7 +8162,7 @@ func file_cosmos_base_abci_v1beta1_abci_proto_rawDescGZIP() []byte { return file_cosmos_base_abci_v1beta1_abci_proto_rawDescData } -var file_cosmos_base_abci_v1beta1_abci_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_cosmos_base_abci_v1beta1_abci_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_cosmos_base_abci_v1beta1_abci_proto_goTypes = []interface{}{ (*TxResponse)(nil), // 0: cosmos.base.abci.v1beta1.TxResponse (*ABCIMessageLog)(nil), // 1: cosmos.base.abci.v1beta1.ABCIMessageLog @@ -7341,27 +8174,30 @@ var file_cosmos_base_abci_v1beta1_abci_proto_goTypes = []interface{}{ (*MsgData)(nil), // 7: cosmos.base.abci.v1beta1.MsgData (*TxMsgData)(nil), // 8: cosmos.base.abci.v1beta1.TxMsgData (*SearchTxsResult)(nil), // 9: cosmos.base.abci.v1beta1.SearchTxsResult - (*anypb.Any)(nil), // 10: google.protobuf.Any - (*abci.Event)(nil), // 11: tendermint.abci.Event + (*SearchBlocksResult)(nil), // 10: cosmos.base.abci.v1beta1.SearchBlocksResult + (*anypb.Any)(nil), // 11: google.protobuf.Any + (*abci.Event)(nil), // 12: tendermint.abci.Event + (*types.Block)(nil), // 13: tendermint.types.Block } var file_cosmos_base_abci_v1beta1_abci_proto_depIdxs = []int32{ 1, // 0: cosmos.base.abci.v1beta1.TxResponse.logs:type_name -> cosmos.base.abci.v1beta1.ABCIMessageLog - 10, // 1: cosmos.base.abci.v1beta1.TxResponse.tx:type_name -> google.protobuf.Any - 11, // 2: cosmos.base.abci.v1beta1.TxResponse.events:type_name -> tendermint.abci.Event + 11, // 1: cosmos.base.abci.v1beta1.TxResponse.tx:type_name -> google.protobuf.Any + 12, // 2: cosmos.base.abci.v1beta1.TxResponse.events:type_name -> tendermint.abci.Event 2, // 3: cosmos.base.abci.v1beta1.ABCIMessageLog.events:type_name -> cosmos.base.abci.v1beta1.StringEvent 3, // 4: cosmos.base.abci.v1beta1.StringEvent.attributes:type_name -> cosmos.base.abci.v1beta1.Attribute - 11, // 5: cosmos.base.abci.v1beta1.Result.events:type_name -> tendermint.abci.Event - 10, // 6: cosmos.base.abci.v1beta1.Result.msg_responses:type_name -> google.protobuf.Any + 12, // 5: cosmos.base.abci.v1beta1.Result.events:type_name -> tendermint.abci.Event + 11, // 6: cosmos.base.abci.v1beta1.Result.msg_responses:type_name -> google.protobuf.Any 4, // 7: cosmos.base.abci.v1beta1.SimulationResponse.gas_info:type_name -> cosmos.base.abci.v1beta1.GasInfo 5, // 8: cosmos.base.abci.v1beta1.SimulationResponse.result:type_name -> cosmos.base.abci.v1beta1.Result 7, // 9: cosmos.base.abci.v1beta1.TxMsgData.data:type_name -> cosmos.base.abci.v1beta1.MsgData - 10, // 10: cosmos.base.abci.v1beta1.TxMsgData.msg_responses:type_name -> google.protobuf.Any + 11, // 10: cosmos.base.abci.v1beta1.TxMsgData.msg_responses:type_name -> google.protobuf.Any 0, // 11: cosmos.base.abci.v1beta1.SearchTxsResult.txs:type_name -> cosmos.base.abci.v1beta1.TxResponse - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 13, // 12: cosmos.base.abci.v1beta1.SearchBlocksResult.blocks:type_name -> tendermint.types.Block + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_cosmos_base_abci_v1beta1_abci_proto_init() } @@ -7490,6 +8326,18 @@ func file_cosmos_base_abci_v1beta1_abci_proto_init() { return nil } } + file_cosmos_base_abci_v1beta1_abci_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchBlocksResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -7497,7 +8345,7 @@ func file_cosmos_base_abci_v1beta1_abci_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_base_abci_v1beta1_abci_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/staking/v1beta1/tx.pulsar.go b/api/cosmos/staking/v1beta1/tx.pulsar.go index 81789ad31a9c..0a0e3b8b0e50 100644 --- a/api/cosmos/staking/v1beta1/tx.pulsar.go +++ b/api/cosmos/staking/v1beta1/tx.pulsar.go @@ -7125,7 +7125,8 @@ type MsgCreateValidator struct { Commission *CommissionRates `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission,omitempty"` MinSelfDelegation string `protobuf:"bytes,3,opt,name=min_self_delegation,json=minSelfDelegation,proto3" json:"min_self_delegation,omitempty"` // Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. - // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer only in bech32 notation). + // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + // only in bech32 notation). // // Deprecated: Do not use. DelegatorAddress string `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` diff --git a/client/cometbft.go b/client/cometbft.go index 43f464701608..595ea6492d24 100644 --- a/client/cometbft.go +++ b/client/cometbft.go @@ -15,6 +15,7 @@ type CometRPC interface { Validators(ctx context.Context, height *int64, page, perPage *int) (*coretypes.ResultValidators, error) Status(context.Context) (*coretypes.ResultStatus, error) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) + BlockByHash(ctx context.Context, hash []byte) (*coretypes.ResultBlock, error) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) Tx(ctx context.Context, hash []byte, prove bool) (*coretypes.ResultTx, error) @@ -25,4 +26,10 @@ type CometRPC interface { page, perPage *int, orderBy string, ) (*coretypes.ResultTxSearch, error) + BlockSearch( + ctx context.Context, + query string, + page, perPage *int, + orderBy string, + ) (*coretypes.ResultBlockSearch, error) } diff --git a/client/rpc/block.go b/client/rpc/block.go index 1594fe9e669e..5b7540f6df14 100644 --- a/client/rpc/block.go +++ b/client/rpc/block.go @@ -2,57 +2,74 @@ package rpc import ( "context" + "encoding/hex" "fmt" - "strconv" - - "github.com/spf13/cobra" + "time" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec/legacy" + + cmt "github.com/cometbft/cometbft/proto/tendermint/types" + coretypes "github.com/cometbft/cometbft/rpc/core/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) -// BlockCommand returns the verified block data for a given heights -func BlockCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "block [height]", - Short: "Get verified data for the block at given height", - Args: cobra.MaximumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - var height *int64 - - // optional height - if len(args) > 0 { - h, err := strconv.Atoi(args[0]) - if err != nil { - return err - } - if h > 0 { - tmp := int64(h) - height = &tmp - } - } - - output, err := getBlock(clientCtx, height) - if err != nil { - return err - } - - fmt.Println(string(output)) - return nil - }, +// GetChainHeight returns the current blockchain height. +func GetChainHeight(clientCtx client.Context) (int64, error) { + node, err := clientCtx.GetNode() + if err != nil { + return -1, err } - cmd.Flags().StringP(flags.FlagNode, "n", "tcp://localhost:26657", "Node to connect to") + status, err := node.Status(context.Background()) + if err != nil { + return -1, err + } - return cmd + height := status.SyncInfo.LatestBlockHeight + return height, nil } -func getBlock(clientCtx client.Context, height *int64) ([]byte, error) { +// QueryBlocks performs a search for blocks based on BeginBlock and EndBlock +// events via the CometBFT RPC. A custom query may be passed as described below: +// +// To tell which events you want, you need to provide a query. query is a +// string, which has a form: "condition AND condition ..." (no OR at the +// moment). condition has a form: "key operation operand". key is a string with +// a restricted set of possible symbols ( \t\n\r\\()"'=>< are not allowed). +// operation can be "=", "<", "<=", ">", ">=", "CONTAINS" AND "EXISTS". operand +// can be a string (escaped with single quotes), number, date or time. + +// Examples: +// tm.event = 'NewBlock' # new blocks +// tm.event = 'CompleteProposal' # node got a complete proposal +// tm.event = 'Tx' AND tx.hash = 'XYZ' # single transaction +// tm.event = 'Tx' AND tx.height = 5 # all txs of the fifth block +// tx.height = 5 # all txs of the fifth block +// +// For more information, see the /subscribe CometBFT RPC endpoint documentation +func QueryBlocks(clientCtx client.Context, page, limit int, query string, orderBy string) (*sdk.SearchBlocksResult, error) { + node, err := clientCtx.GetNode() + if err != nil { + return nil, err + } + + resBlocks, err := node.BlockSearch(context.Background(), query, &page, &limit, orderBy) + if err != nil { + return nil, err + } + + blocks, err := formatBlockResults(resBlocks.Blocks) + if err != nil { + return nil, err + } + + result := sdk.NewSearchBlocksResult(int64(resBlocks.TotalCount), int64(len(blocks)), int64(page), int64(limit), blocks) + + return result, nil +} + +// get block by height +func GetBlockByHeight(clientCtx client.Context, height *int64) (*cmt.Block, error) { // get the node node, err := clientCtx.GetNode() if err != nil { @@ -62,26 +79,56 @@ func getBlock(clientCtx client.Context, height *int64) ([]byte, error) { // header -> BlockchainInfo // header, tx -> Block // results -> BlockResults - res, err := node.Block(context.Background(), height) + resBlock, err := node.Block(context.Background(), height) if err != nil { return nil, err } - return legacy.Cdc.MarshalJSON(res) + out := sdk.NewResponseResultBlock(resBlock, resBlock.Block.Time.Format(time.RFC3339)) + if out == nil { + return nil, fmt.Errorf("unable to create response block from comet result block: %v", resBlock) + } + + return out, nil } -// get the current blockchain height -func GetChainHeight(clientCtx client.Context) (int64, error) { +func GetBlockByHash(clientCtx client.Context, hashHexString string) (*cmt.Block, error) { + hash, err := hex.DecodeString(hashHexString) + if err != nil { + return nil, err + } + + // get the node node, err := clientCtx.GetNode() if err != nil { - return -1, err + return nil, err } - status, err := node.Status(context.Background()) + resBlock, err := node.BlockByHash(context.Background(), hash) + if err != nil { - return -1, err + return nil, err + } else if resBlock.Block == nil { + return nil, fmt.Errorf("block not found with hash: %s", hashHexString) } - height := status.SyncInfo.LatestBlockHeight - return height, nil + out := sdk.NewResponseResultBlock(resBlock, resBlock.Block.Time.Format(time.RFC3339)) + if out == nil { + return nil, fmt.Errorf("unable to create response block from comet result block: %v", resBlock) + } + + return out, nil +} + +// formatBlockResults parses the indexed blocks into a slice of BlockResponse objects. +func formatBlockResults(resBlocks []*coretypes.ResultBlock) ([]*cmt.Block, error) { + out := make([]*cmt.Block, len(resBlocks)) + for i := range resBlocks { + out[i] = sdk.NewResponseResultBlock(resBlocks[i], resBlocks[i].Block.Time.Format(time.RFC3339)) + if out[i] == nil { + return nil, fmt.Errorf("unable to create response block from comet result block: %v", resBlocks[i]) + } + } + + return out, nil } diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index 992f38999b8e..d317eb5bc8d3 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -219,7 +219,6 @@ message QuerySpendableBalanceByDenomResponse { cosmos.base.v1beta1.Coin balance = 1; } - // QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC // method. message QueryTotalSupplyRequest { diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto index ddaa63561774..9e3b4e55dbc7 100644 --- a/proto/cosmos/base/abci/v1beta1/abci.proto +++ b/proto/cosmos/base/abci/v1beta1/abci.proto @@ -3,6 +3,7 @@ package cosmos.base.abci.v1beta1; import "gogoproto/gogo.proto"; import "tendermint/abci/types.proto"; +import "tendermint/types/block.proto"; import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/types"; @@ -156,3 +157,21 @@ message SearchTxsResult { // List of txs in current page repeated TxResponse txs = 6; } + +// SearchBlocksResult defines a structure for querying blocks pageable +message SearchBlocksResult { + option (gogoproto.stringer) = true; + + // Count of all blocks + int64 total_count = 1; + // Count of blocks in current page + int64 count = 2; + // Index of current page, start from 1 + int64 page_number = 3; + // Count of total pages + int64 page_total = 4; + // Max count blocks per page + int64 limit = 5; + // List of blocks in current page + repeated tendermint.types.Block blocks = 6; +} diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index 3625cac380c0..a82ae10c8210 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cosmos.distribution.v1beta1; -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; @@ -17,23 +17,19 @@ service Msg { // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). - rpc SetWithdrawAddress(MsgSetWithdrawAddress) - returns (MsgSetWithdrawAddressResponse); + rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); // WithdrawDelegatorReward defines a method to withdraw rewards of delegator // from a single validator. - rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) - returns (MsgWithdrawDelegatorRewardResponse); + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); // WithdrawValidatorCommission defines a method to withdraw the // full commission to the validator address. - rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) - returns (MsgWithdrawValidatorCommissionResponse); + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); // FundCommunityPool defines a method to allow an account to directly // fund the community pool. - rpc FundCommunityPool(MsgFundCommunityPool) - returns (MsgFundCommunityPoolResponse); + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); // UpdateParams defines a governance operation for updating the x/distribution // module parameters. The authority is defined in the keeper. @@ -47,15 +43,13 @@ service Msg { // keeper. // // Since: cosmos-sdk 0.47 - rpc CommunityPoolSpend(MsgCommunityPoolSpend) - returns (MsgCommunityPoolSpendResponse); + rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); // DepositValidatorRewardsPool defines a method to provide additional rewards // to delegators to a specific validator. // // Since: cosmos-sdk 0.48 - rpc DepositValidatorRewardsPool(MsgDepositValidatorRewardsPool) - returns (MsgDepositValidatorRewardsPoolResponse); + rpc DepositValidatorRewardsPool(MsgDepositValidatorRewardsPool) returns (MsgDepositValidatorRewardsPoolResponse); } // MsgSetWithdrawAddress sets the withdraw address for @@ -155,8 +149,7 @@ message MsgUpdateParams { // params defines the x/distribution parameters to update. // // NOTE: All parameters must be supplied. - Params params = 2 - [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgUpdateParamsResponse defines the response structure for executing a @@ -175,8 +168,8 @@ message MsgCommunityPoolSpend { option (amino.name) = "cosmos-sdk/distr/MsgCommunityPoolSpend"; // authority is the address that controls the module (defaults to x/gov unless overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string recipient = 2; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string recipient = 2; repeated cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true, @@ -200,12 +193,10 @@ message MsgDepositValidatorRewardsPool { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // MsgDepositValidatorRewardsPoolResponse defines the response to executing a diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index bc0d3d29d101..87bde2969f37 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -224,7 +224,7 @@ message Params { // // Since: cosmos-sdk 0.48 string proposal_cancel_ratio = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; - + // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. // diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index a7415fec135e..63a417499291 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -63,7 +63,8 @@ message MsgCreateValidator { (gogoproto.nullable) = false ]; // Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. - // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer only in bech32 notation). + // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + // only in bech32 notation). string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString", deprecated = true]; string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index 277dad41c592..5dfb289db530 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -54,13 +54,13 @@ message SoftwareUpgradeProposal { option (gogoproto.equal) = true; // title of the proposal - string title = 1; + string title = 1; // description of the proposal string description = 2; // plan of the proposal - Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software @@ -74,7 +74,7 @@ message CancelSoftwareUpgradeProposal { option (gogoproto.equal) = true; // title of the proposal - string title = 1; + string title = 1; // description of the proposal string description = 2; diff --git a/server/cmt_cmds.go b/server/cmt_cmds.go index 131444aa062e..a37cc53173d9 100644 --- a/server/cmt_cmds.go +++ b/server/cmt_cmds.go @@ -2,6 +2,8 @@ package server import ( "fmt" + "strconv" + "strings" "github.com/cometbft/cometbft/p2p" pvm "github.com/cometbft/cometbft/privval" @@ -10,8 +12,13 @@ import ( "sigs.k8s.io/yaml" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + rpc "github.com/cosmos/cosmos-sdk/client/rpc" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/version" + auth "github.com/cosmos/cosmos-sdk/x/auth/client/cli" ) // ShowNodeIDCmd - ported from CometBFT, dump node ID to stdout @@ -115,3 +122,130 @@ func VersionCmd() *cobra.Command { }, } } + +// QueryBlocksCmd returns a command to search through blocks by events. +func QueryBlocksCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "blocks", + Short: "Query for paginated blocks that match a set of events", + Long: `Search for blocks that match the exact given events where results are paginated. +The events query is directly passed to CometBFT's RPC BlockSearch method and must +conform to CometBFT'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'. +`, + Example: fmt.Sprintf( + "$ %s query blocks --query \"message.sender='cosmos1...' AND block.height > 7\" --page 1 --limit 30 --order-by ASC", + version.AppName, + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + query, _ := cmd.Flags().GetString(auth.FlagQuery) + page, _ := cmd.Flags().GetInt(flags.FlagPage) + limit, _ := cmd.Flags().GetInt(flags.FlagLimit) + orderBy, _ := cmd.Flags().GetString(auth.FlagOrderBy) + + blocks, err := rpc.QueryBlocks(clientCtx, page, limit, query, orderBy) + if err != nil { + return err + } + + return clientCtx.PrintProto(blocks) + }, + } + + 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(auth.FlagQuery, "", "The blocks events query per CometBFT's query semantics") + cmd.Flags().String(auth.FlagOrderBy, "", "The ordering semantics (asc|dsc)") + _ = cmd.MarkFlagRequired(auth.FlagQuery) + + return cmd +} + +// QueryBlockCmd implements the default command for a Block query. +func QueryBlockCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "block --type=[height|hash] [height|hash]", + Short: "Query for a committed block by height, hash, or event(s)", + Long: "Query for a specific committed block using the CometBFT RPC `block` and `block_by_hash` method", + Example: strings.TrimSpace(fmt.Sprintf(` +$ %s query block --%s=%s +$ %s query block --%s=%s +`, + version.AppName, auth.FlagType, auth.TypeHeight, + version.AppName, auth.FlagType, auth.TypeHash)), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + typ, _ := cmd.Flags().GetString(auth.FlagType) + + switch typ { + case auth.TypeHeight: + + if args[0] == "" { + return fmt.Errorf("argument should be a block height") + } + + var height *int64 + + // optional height + if len(args) > 0 { + h, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + if h > 0 { + tmp := int64(h) + height = &tmp + } + } + + output, err := rpc.GetBlockByHeight(clientCtx, height) + if err != nil { + return err + } + + if output.Header.Height == 0 { + return fmt.Errorf("no block found with height %s", args[0]) + } + + return clientCtx.PrintProto(output) + + case auth.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 := rpc.GetBlockByHash(clientCtx, args[0]) + if err != nil { + return err + } + + if output.Header.AppHash == nil { + return fmt.Errorf("no block found with hash %s", args[0]) + } + + return clientCtx.PrintProto(output) + + default: + return fmt.Errorf("unknown --%s value %s", auth.FlagType, typ) + } + }, + } + + flags.AddQueryFlagsToCmd(cmd) + cmd.Flags().String(auth.FlagType, auth.TypeHash, fmt.Sprintf("The type to be used when querying tx, can be one of \"%s\", \"%s\"", auth.TypeHeight, auth.TypeHash)) + + return cmd +} diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index c830137aceb4..f572b81545f7 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -235,8 +235,9 @@ func queryCommand() *cobra.Command { cmd.AddCommand( authcmd.GetAccountCmd(), rpc.ValidatorCommand(), - rpc.BlockCommand(), + server.QueryBlockCmd(), authcmd.QueryTxsByEventsCmd(), + server.QueryBlocksCmd(), authcmd.QueryTxCmd(), ) diff --git a/types/abci.pb.go b/types/abci.pb.go index 4cc102bc1ac5..5f4da7f089d1 100644 --- a/types/abci.pb.go +++ b/types/abci.pb.go @@ -6,6 +6,7 @@ package types import ( fmt "fmt" types1 "github.com/cometbft/cometbft/abci/types" + types2 "github.com/cometbft/cometbft/proto/tendermint/types" types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -619,6 +620,96 @@ func (m *SearchTxsResult) GetTxs() []*TxResponse { return nil } +// SearchBlocksResult defines a structure for querying blocks pageable +type SearchBlocksResult struct { + // Count of all blocks + TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + // Count of blocks in current page + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + // Index of current page, start from 1 + PageNumber int64 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + // Count of total pages + PageTotal int64 `protobuf:"varint,4,opt,name=page_total,json=pageTotal,proto3" json:"page_total,omitempty"` + // Max count blocks per page + Limit int64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + // List of blocks in current page + Blocks []*types2.Block `protobuf:"bytes,6,rep,name=blocks,proto3" json:"blocks,omitempty"` +} + +func (m *SearchBlocksResult) Reset() { *m = SearchBlocksResult{} } +func (*SearchBlocksResult) ProtoMessage() {} +func (*SearchBlocksResult) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{10} +} +func (m *SearchBlocksResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SearchBlocksResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SearchBlocksResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SearchBlocksResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_SearchBlocksResult.Merge(m, src) +} +func (m *SearchBlocksResult) XXX_Size() int { + return m.Size() +} +func (m *SearchBlocksResult) XXX_DiscardUnknown() { + xxx_messageInfo_SearchBlocksResult.DiscardUnknown(m) +} + +var xxx_messageInfo_SearchBlocksResult proto.InternalMessageInfo + +func (m *SearchBlocksResult) GetTotalCount() int64 { + if m != nil { + return m.TotalCount + } + return 0 +} + +func (m *SearchBlocksResult) GetCount() int64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *SearchBlocksResult) GetPageNumber() int64 { + if m != nil { + return m.PageNumber + } + return 0 +} + +func (m *SearchBlocksResult) GetPageTotal() int64 { + if m != nil { + return m.PageTotal + } + return 0 +} + +func (m *SearchBlocksResult) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *SearchBlocksResult) GetBlocks() []*types2.Block { + if m != nil { + return m.Blocks + } + return nil +} + func init() { proto.RegisterType((*TxResponse)(nil), "cosmos.base.abci.v1beta1.TxResponse") proto.RegisterType((*ABCIMessageLog)(nil), "cosmos.base.abci.v1beta1.ABCIMessageLog") @@ -630,6 +721,7 @@ func init() { proto.RegisterType((*MsgData)(nil), "cosmos.base.abci.v1beta1.MsgData") proto.RegisterType((*TxMsgData)(nil), "cosmos.base.abci.v1beta1.TxMsgData") proto.RegisterType((*SearchTxsResult)(nil), "cosmos.base.abci.v1beta1.SearchTxsResult") + proto.RegisterType((*SearchBlocksResult)(nil), "cosmos.base.abci.v1beta1.SearchBlocksResult") } func init() { @@ -637,64 +729,68 @@ func init() { } var fileDescriptor_4e37629bc7eb0df8 = []byte{ - // 909 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xda, 0xdb, 0x75, 0x3c, 0x8e, 0x29, 0x1a, 0x45, 0xe9, 0xa4, 0x80, 0x6d, 0xdc, 0x22, - 0x59, 0x48, 0xac, 0xd5, 0xb4, 0x42, 0xb4, 0xa7, 0xd6, 0xe1, 0x2b, 0x52, 0xcb, 0x61, 0xe3, 0x0a, - 0x89, 0x8b, 0x35, 0xb6, 0xa7, 0xe3, 0x55, 0xbd, 0x3b, 0xd6, 0xce, 0x6c, 0xb2, 0xb9, 0x71, 0x83, - 0x23, 0x27, 0xce, 0x5c, 0xe1, 0x2f, 0xe9, 0x81, 0x43, 0x8e, 0x3d, 0x54, 0x01, 0x92, 0x1b, 0x7f, - 0x05, 0x7a, 0x6f, 0xc6, 0x1f, 0x25, 0x75, 0xd5, 0x93, 0xdf, 0xfc, 0xde, 0x87, 0xdf, 0xfb, 0xbd, - 0xdf, 0xce, 0x90, 0x5b, 0x63, 0xa5, 0x13, 0xa5, 0x7b, 0x23, 0xae, 0x45, 0x8f, 0x8f, 0xc6, 0x71, - 0xef, 0xf8, 0xce, 0x48, 0x18, 0x7e, 0x07, 0x0f, 0xe1, 0x3c, 0x53, 0x46, 0x51, 0x66, 0x83, 0x42, - 0x08, 0x0a, 0x11, 0x77, 0x41, 0x37, 0x77, 0xa4, 0x92, 0x0a, 0x83, 0x7a, 0x60, 0xd9, 0xf8, 0x9b, - 0x1f, 0x18, 0x91, 0x4e, 0x44, 0x96, 0xc4, 0xa9, 0xb1, 0x35, 0xcd, 0xe9, 0x5c, 0x68, 0xe7, 0xdc, - 0x93, 0x4a, 0xc9, 0x99, 0xe8, 0xe1, 0x69, 0x94, 0x3f, 0xeb, 0xf1, 0xf4, 0xd4, 0xba, 0x3a, 0x7f, - 0x56, 0x08, 0x19, 0x14, 0x91, 0xd0, 0x73, 0x95, 0x6a, 0x41, 0x77, 0x49, 0x30, 0x15, 0xb1, 0x9c, - 0x1a, 0xe6, 0xb5, 0xbd, 0x6e, 0x25, 0x72, 0x27, 0xda, 0x21, 0x81, 0x29, 0xa6, 0x5c, 0x4f, 0x59, - 0xb9, 0xed, 0x75, 0x6b, 0x7d, 0x72, 0x71, 0xde, 0x0a, 0x06, 0xc5, 0xb7, 0x5c, 0x4f, 0x23, 0xe7, - 0xa1, 0x1f, 0x92, 0xda, 0x58, 0x4d, 0x84, 0x9e, 0xf3, 0xb1, 0x60, 0x15, 0x08, 0x8b, 0x56, 0x00, - 0xa5, 0xc4, 0x87, 0x03, 0xf3, 0xdb, 0x5e, 0xb7, 0x11, 0xa1, 0x0d, 0xd8, 0x84, 0x1b, 0xce, 0xae, - 0x61, 0x30, 0xda, 0xf4, 0x06, 0xa9, 0x66, 0xfc, 0x64, 0x38, 0x53, 0x92, 0x05, 0x08, 0x07, 0x19, - 0x3f, 0x79, 0xac, 0x24, 0x7d, 0x4a, 0xfc, 0x99, 0x92, 0x9a, 0x55, 0xdb, 0x95, 0x6e, 0x7d, 0xbf, -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 0x3d, 0x1f, 0x11, 0x24, 0xd8, 0xf1, 0xfa, 0x0f, 0x5f, 0xfe, 0xd3, 0x2c, 0xbd, - 0xb8, 0x68, 0x7a, 0x67, 0x17, 0x4d, 0xef, 0xef, 0x8b, 0xa6, 0xf7, 0xcb, 0x65, 0xb3, 0x74, 0x76, - 0xd9, 0x2c, 0xbd, 0xbc, 0x6c, 0x96, 0x7e, 0xe8, 0xc8, 0xd8, 0x4c, 0xf3, 0x51, 0x38, 0x56, 0x49, - 0xcf, 0x3d, 0x87, 0xf6, 0xe7, 0x33, 0x3d, 0x79, 0x6e, 0xdf, 0xae, 0x51, 0x80, 0x14, 0xde, 0xfd, - 0x2f, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xf1, 0x8e, 0x98, 0x30, 0x07, 0x00, 0x00, + // 968 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x4f, 0x6f, 0x1b, 0xb7, + 0x13, 0xd5, 0x6a, 0x37, 0x2b, 0x8b, 0xb2, 0x7e, 0xf9, 0x81, 0x30, 0x6c, 0x3a, 0x4d, 0x25, 0x55, + 0x49, 0x01, 0xa1, 0x40, 0x57, 0x88, 0x13, 0x14, 0x4d, 0x4e, 0x89, 0xdc, 0x7f, 0x06, 0x92, 0x1e, + 0xd6, 0x0a, 0x0a, 0xf4, 0x22, 0x50, 0x12, 0x43, 0x2d, 0xac, 0x5d, 0x0a, 0x4b, 0xca, 0x96, 0x6f, + 0xbd, 0xb5, 0xc7, 0x9e, 0x7a, 0xee, 0xb5, 0xfd, 0x24, 0x39, 0xf4, 0xe0, 0xa3, 0x0f, 0x81, 0xdb, + 0xda, 0xb7, 0x7e, 0x8a, 0x62, 0x86, 0xd4, 0x9f, 0xd4, 0x95, 0x9b, 0x93, 0x87, 0x6f, 0x86, 0xd4, + 0xbc, 0x37, 0x6f, 0x49, 0x93, 0x7b, 0x03, 0xa5, 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x88, 0xed, 0x82, 0x7e, 0x42, 0x7c, 0x33, 0xd3, 0x2c, 0x44, 0x5e, 0xf7, 0xd7, 0x6b, + 0xb3, 0x7c, 0x3e, 0x62, 0xd8, 0xe0, 0xe8, 0x9d, 0x83, 0x87, 0x90, 0x5e, 0x07, 0x5e, 0xa2, 0x1b, + 0x18, 0xfa, 0xeb, 0x19, 0xfa, 0x37, 0x30, 0xf4, 0xff, 0x83, 0xa1, 0xbf, 0x96, 0xa1, 0x3f, 0x67, + 0xd8, 0x26, 0x21, 0x3e, 0x93, 0x73, 0x92, 0x3b, 0xab, 0x9f, 0x97, 0x7d, 0x5e, 0xb1, 0xf9, 0xd8, + 0x95, 0x59, 0x6a, 0x9d, 0xa7, 0xe7, 0x7f, 0xd6, 0x0a, 0xaf, 0x2f, 0x6b, 0xde, 0xd9, 0x65, 0xcd, + 0xfb, 0xe3, 0xb2, 0xe6, 0xfd, 0x78, 0x55, 0x2b, 0x9c, 0x5d, 0xd5, 0x0a, 0xe7, 0x57, 0xb5, 0xc2, + 0xb7, 0x4d, 0x99, 0x98, 0xd1, 0xb4, 0x1f, 0x0d, 0x54, 0xda, 0x76, 0xff, 0x07, 0xd8, 0x3f, 0x1f, + 0xeb, 0xe1, 0x91, 0x7d, 0x9c, 0xfb, 0x21, 0xba, 0xe3, 0xe1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x4d, 0x51, 0x55, 0xd9, 0x29, 0x08, 0x00, 0x00, } func (m *TxResponse) Marshal() (dAtA []byte, err error) { @@ -1245,6 +1341,68 @@ func (m *SearchTxsResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *SearchBlocksResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SearchBlocksResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SearchBlocksResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Blocks) > 0 { + for iNdEx := len(m.Blocks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Blocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.Limit != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x28 + } + if m.PageTotal != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.PageTotal)) + i-- + dAtA[i] = 0x20 + } + if m.PageNumber != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.PageNumber)) + i-- + dAtA[i] = 0x18 + } + if m.Count != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x10 + } + if m.TotalCount != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.TotalCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintAbci(dAtA []byte, offset int, v uint64) int { offset -= sovAbci(v) base := offset @@ -1502,6 +1660,36 @@ func (m *SearchTxsResult) Size() (n int) { return n } +func (m *SearchBlocksResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalCount != 0 { + n += 1 + sovAbci(uint64(m.TotalCount)) + } + if m.Count != 0 { + n += 1 + sovAbci(uint64(m.Count)) + } + if m.PageNumber != 0 { + n += 1 + sovAbci(uint64(m.PageNumber)) + } + if m.PageTotal != 0 { + n += 1 + sovAbci(uint64(m.PageTotal)) + } + if m.Limit != 0 { + n += 1 + sovAbci(uint64(m.Limit)) + } + if len(m.Blocks) > 0 { + for _, e := range m.Blocks { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + return n +} + func sovAbci(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1593,6 +1781,26 @@ func (this *SearchTxsResult) String() string { }, "") return s } +func (this *SearchBlocksResult) String() string { + if this == nil { + return "nil" + } + repeatedStringForBlocks := "[]*Block{" + for _, f := range this.Blocks { + repeatedStringForBlocks += strings.Replace(fmt.Sprintf("%v", f), "Block", "types2.Block", 1) + "," + } + repeatedStringForBlocks += "}" + s := strings.Join([]string{`&SearchBlocksResult{`, + `TotalCount:` + fmt.Sprintf("%v", this.TotalCount) + `,`, + `Count:` + fmt.Sprintf("%v", this.Count) + `,`, + `PageNumber:` + fmt.Sprintf("%v", this.PageNumber) + `,`, + `PageTotal:` + fmt.Sprintf("%v", this.PageTotal) + `,`, + `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, + `Blocks:` + repeatedStringForBlocks + `,`, + `}`, + }, "") + return s +} func valueToStringAbci(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -3192,6 +3400,185 @@ func (m *SearchTxsResult) Unmarshal(dAtA []byte) error { } return nil } +func (m *SearchBlocksResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SearchBlocksResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchBlocksResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalCount", wireType) + } + m.TotalCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PageNumber", wireType) + } + m.PageNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PageNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PageTotal", wireType) + } + m.PageTotal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PageTotal |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blocks = append(m.Blocks, &types2.Block{}) + if err := m.Blocks[len(m.Blocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipAbci(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/types/result.go b/types/result.go index 7f4910ac45ec..3d5e20080e4a 100644 --- a/types/result.go +++ b/types/result.go @@ -3,13 +3,13 @@ package types import ( "encoding/hex" "encoding/json" - "math" "strings" abci "github.com/cometbft/cometbft/abci/types" coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/gogoproto/proto" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" ) @@ -83,6 +83,25 @@ func NewResponseResultTx(res *coretypes.ResultTx, anyTx *codectypes.Any, timesta } } +// NewResponseResultBlock returns a BlockResponse given a ResultBlock from CometBFT +func NewResponseResultBlock(res *coretypes.ResultBlock, timestamp string) *cmtproto.Block { + if res == nil { + return nil + } + + blk, err := res.Block.ToProto() + if err != nil { + return nil + } + + return &cmtproto.Block{ + Header: blk.Header, + Data: blk.Data, + Evidence: blk.Evidence, + LastCommit: blk.LastCommit, + } +} + // NewResponseFormatBroadcastTx returns a TxResponse given a ResultBroadcastTx from tendermint func NewResponseFormatBroadcastTx(res *coretypes.ResultBroadcastTx) *TxResponse { if res == nil { @@ -112,16 +131,31 @@ func (r TxResponse) Empty() bool { } func NewSearchTxsResult(totalCount, count, page, limit uint64, txs []*TxResponse) *SearchTxsResult { + totalPages := calcTotalPages(int64(totalCount), int64(limit)) + return &SearchTxsResult{ TotalCount: totalCount, Count: count, PageNumber: page, - PageTotal: uint64(math.Ceil(float64(totalCount) / float64(limit))), + PageTotal: uint64(totalPages), Limit: limit, Txs: txs, } } +func NewSearchBlocksResult(totalCount, count, page, limit int64, blocks []*cmtproto.Block) *SearchBlocksResult { + totalPages := calcTotalPages(totalCount, limit) + + return &SearchBlocksResult{ + TotalCount: totalCount, + Count: count, + PageNumber: page, + PageTotal: totalPages, + Limit: limit, + Blocks: blocks, + } +} + // ParseABCILogs attempts to parse a stringified ABCI tx log into a slice of // ABCIMessageLog types. It returns an error upon JSON decoding failure. func ParseABCILogs(logs string) (res ABCIMessageLogs, err error) { @@ -194,3 +228,16 @@ func WrapServiceResult(ctx Context, res proto.Message, err error) (*Result, erro MsgResponses: []*codectypes.Any{any}, }, nil } + +// calculate total pages in an overflow safe manner +func calcTotalPages(totalCount int64, limit int64) int64 { + totalPages := int64(0) + if totalCount != 0 && limit != 0 { + if totalCount%limit > 0 { + totalPages = totalCount/limit + 1 + } else { + totalPages = totalCount / limit + } + } + return totalPages +} diff --git a/types/result_test.go b/types/result_test.go index 8715ccf0e676..bd1276975dff 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -5,6 +5,7 @@ import ( "fmt" "strings" "testing" + "time" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/bytes" @@ -13,6 +14,8 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + cmtt "github.com/cometbft/cometbft/proto/tendermint/types" + cmt "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -139,6 +142,44 @@ txhash: "74657374" s.Require().Equal((*sdk.TxResponse)(nil), sdk.NewResponseFormatBroadcastTx(nil)) } +func (s *resultTestSuite) TestNewSearchBlocksResult() { + got := sdk.NewSearchBlocksResult(150, 20, 2, 20, []*cmtt.Block{}) + s.Require().Equal(&sdk.SearchBlocksResult{ + TotalCount: 150, + Count: 20, + PageNumber: 2, + PageTotal: 8, + Limit: 20, + Blocks: []*cmtt.Block{}, + }, got) +} + +func (s *resultTestSuite) TestResponseResultBlock() { + timestamp := time.Now() + timestampStr := timestamp.UTC().Format(time.RFC3339) + + // create a block + resultBlock := &coretypes.ResultBlock{Block: &cmt.Block{ + Header: cmt.Header{ + Height: 10, + Time: timestamp, + }, + Evidence: cmt.EvidenceData{ + Evidence: make(cmt.EvidenceList, 0), + }, + }} + + blk, err := resultBlock.Block.ToProto() + s.Require().NoError(err) + + want := &cmtt.Block{ + Header: blk.Header, + Evidence: blk.Evidence, + } + + s.Require().Equal(want, sdk.NewResponseResultBlock(resultBlock, timestampStr)) +} + func TestWrapServiceResult(t *testing.T) { ctx := sdk.Context{} diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 5f7ba3a6f856..89c18cfcd86f 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -20,14 +20,17 @@ import ( ) const ( - flagEvents = "events" - flagType = "type" + FlagEvents = "events" // TODO: Remove when #14758 is merged + FlagQuery = "query" + FlagType = "type" + FlagOrderBy = "order_by" - typeHash = "hash" - typeAccSeq = "acc_seq" - typeSig = "signature" + TypeHash = "hash" + TypeAccSeq = "acc_seq" + TypeSig = "signature" + TypeHeight = "height" - eventFormat = "{eventType}.{eventAttribute}={value}" + EventFormat = "{eventType}.{eventAttribute}={value}" ) // GetQueryCmd returns the transaction commands for this module @@ -270,14 +273,14 @@ documents its respective events under 'xx_events.md'. Example: $ %s query txs --%s 'message.sender=cosmos1...&message.action=withdraw_delegator_reward' --page 1 --limit 30 -`, eventFormat, version.AppName, flagEvents), +`, EventFormat, version.AppName, FlagEvents), ), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } - eventsRaw, _ := cmd.Flags().GetString(flagEvents) + eventsRaw, _ := cmd.Flags().GetString(FlagEvents) eventsStr := strings.Trim(eventsRaw, "'") var events []string @@ -291,9 +294,9 @@ $ %s query txs --%s 'message.sender=cosmos1...&message.action=withdraw_delegator for _, event := range events { if !strings.Contains(event, "=") { - return fmt.Errorf("invalid event; event %s should be of the format: %s", event, eventFormat) + 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) + return fmt.Errorf("invalid event; event %s should be of the format: %s", event, EventFormat) } tokens := strings.Split(event, "=") @@ -321,8 +324,8 @@ $ %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().String(FlagEvents, "", fmt.Sprintf("list of transaction events in the form of %s", EventFormat)) + cmd.MarkFlagRequired(FlagEvents) return cmd } @@ -339,8 +342,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) @@ -348,10 +351,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") @@ -369,7 +372,7 @@ $ %s query tx --%s=%s , return clientCtx.PrintProto(output) } - case typeSig: + case TypeSig: { sigParts, err := ParseSigArgs(args) if err != nil { @@ -394,7 +397,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 '/'") @@ -418,13 +421,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 } diff --git a/x/auth/tx/README.md b/x/auth/tx/README.md index 45a5fa455283..0460f69d8b6c 100644 --- a/x/auth/tx/README.md +++ b/x/auth/tx/README.md @@ -85,6 +85,32 @@ When querying a transaction given its signature, use the `--type=signature` flag simd query tx --type=signature Ofjvgrqi8twZfqVDmYIhqwRLQjZZ40XbxEamk/veH3gQpRF0hL2PH4ejRaDzAX+2WChnaWNQJQ41ekToIi5Wqw== ``` +When querying a transaction given its events, use the `--type=events` flag: + +```shell +simd query txs --events 'message.sender=cosmos...' --page 1 --limit 30 +``` + +The `x/auth/block` module provides a CLI command to query any block, given its hash, height, or events. + +When querying a block by its hash, use the `--type=hash` flag: + +```shell +simd query block --type=hash DFE87B78A630C0EFDF76C80CD24C997E252792E0317502AE1A02B9809F0D8685 +``` + +When querying a block by its height, use the `--type=height` flag: + +```shell +simd query block --type=height 1357 +``` + +When querying a block by its events, use the `--query` flag: + +```shell +simd query blocks --query 'message.sender=cosmos...' --page 1 --limit 30 +``` + #### Transactions The `x/auth/tx` module provides a convinient CLI command for decoding and encoding transactions. diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index cb04fc3198f7..510138d3744b 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -44,7 +44,8 @@ type MsgCreateValidator struct { Commission CommissionRates `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"` MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` // Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. - // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer only in bech32 notation). + // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + // only in bech32 notation). DelegatorAddress string `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` // Deprecated: Do not use. ValidatorAddress string `protobuf:"bytes,5,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` Pubkey *types.Any `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"` diff --git a/x/tx/textual/internal/textualpb/textual.proto b/x/tx/textual/internal/textualpb/textual.proto index 3a3056ef8539..efd8d35275bd 100644 --- a/x/tx/textual/internal/textualpb/textual.proto +++ b/x/tx/textual/internal/textualpb/textual.proto @@ -58,7 +58,7 @@ message SignerData { } // Envelope is an internal data structure used to generate the tx envelope -// screens. It is derived from the TextualData struct (also internal) which +// screens. It is derived from the TextualData struct (also internal) which // contains the three following fields: // - body_bytes (from the original tx), // - auth_info_bytes (from the original tx), @@ -67,23 +67,22 @@ message SignerData { // If any of the three structs above is modified, then this Envelope message // also needs to be updated. message Envelope { - string chain_id = 1; - uint64 account_number = 2; - uint64 sequence = 3; - string address = 4; - google.protobuf.Any public_key = 5; - repeated google.protobuf.Any message = 6; - string memo = 7; - repeated cosmos.base.v1beta1.Coin fees = 8; - string fee_payer = 9; - string fee_granter = 10; - repeated cosmos.base.v1beta1.Coin tip = 11; - string tipper = 12; - uint64 gas_limit = 13; - uint64 timeout_height = 14; - repeated cosmos.tx.v1beta1.SignerInfo other_signer = 15; - repeated google.protobuf.Any extension_options = 16; + string chain_id = 1; + uint64 account_number = 2; + uint64 sequence = 3; + string address = 4; + google.protobuf.Any public_key = 5; + repeated google.protobuf.Any message = 6; + string memo = 7; + repeated cosmos.base.v1beta1.Coin fees = 8; + string fee_payer = 9; + string fee_granter = 10; + repeated cosmos.base.v1beta1.Coin tip = 11; + string tipper = 12; + uint64 gas_limit = 13; + uint64 timeout_height = 14; + repeated cosmos.tx.v1beta1.SignerInfo other_signer = 15; + repeated google.protobuf.Any extension_options = 16; repeated google.protobuf.Any non_critical_extension_options = 17; - string hash_of_raw_bytes = 18; + string hash_of_raw_bytes = 18; } -