diff --git a/go.mod b/go.mod index 833ffee..db56e7a 100644 --- a/go.mod +++ b/go.mod @@ -171,7 +171,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v3 v3.0.1 + gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.10 // indirect pgregory.net/rapid v1.1.0 // indirect diff --git a/types/abci.pb.go b/types/abci.pb.go new file mode 100644 index 0000000..6160bda --- /dev/null +++ b/types/abci.pb.go @@ -0,0 +1,765 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cada/v1beta1/abci.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// InjectedData represents a message containing data that has been injected. +type InjectedData struct { + // PendingBlocks contains information about blocks that are pending. + PendingBlocks PendingBlocks `protobuf:"bytes,1,opt,name=pending_blocks,json=pendingBlocks,proto3" json:"pending_blocks"` +} + +func (m *InjectedData) Reset() { *m = InjectedData{} } +func (m *InjectedData) String() string { return proto.CompactTextString(m) } +func (*InjectedData) ProtoMessage() {} +func (*InjectedData) Descriptor() ([]byte, []int) { + return fileDescriptor_c10129946240d9b3, []int{0} +} +func (m *InjectedData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InjectedData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InjectedData.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 *InjectedData) XXX_Merge(src proto.Message) { + xxx_messageInfo_InjectedData.Merge(m, src) +} +func (m *InjectedData) XXX_Size() int { + return m.Size() +} +func (m *InjectedData) XXX_DiscardUnknown() { + xxx_messageInfo_InjectedData.DiscardUnknown(m) +} + +var xxx_messageInfo_InjectedData proto.InternalMessageInfo + +func (m *InjectedData) GetPendingBlocks() PendingBlocks { + if m != nil { + return m.PendingBlocks + } + return PendingBlocks{} +} + +// The PendingBlocks message includes a list of block heights that are currently pending. +type PendingBlocks struct { + BlockHeights []int64 `protobuf:"varint,1,rep,packed,name=block_heights,json=blockHeights,proto3" json:"block_heights,omitempty"` +} + +func (m *PendingBlocks) Reset() { *m = PendingBlocks{} } +func (m *PendingBlocks) String() string { return proto.CompactTextString(m) } +func (*PendingBlocks) ProtoMessage() {} +func (*PendingBlocks) Descriptor() ([]byte, []int) { + return fileDescriptor_c10129946240d9b3, []int{1} +} +func (m *PendingBlocks) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PendingBlocks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PendingBlocks.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 *PendingBlocks) XXX_Merge(src proto.Message) { + xxx_messageInfo_PendingBlocks.Merge(m, src) +} +func (m *PendingBlocks) XXX_Size() int { + return m.Size() +} +func (m *PendingBlocks) XXX_DiscardUnknown() { + xxx_messageInfo_PendingBlocks.DiscardUnknown(m) +} + +var xxx_messageInfo_PendingBlocks proto.InternalMessageInfo + +func (m *PendingBlocks) GetBlockHeights() []int64 { + if m != nil { + return m.BlockHeights + } + return nil +} + +// UnprovenBlock represents a message containing data about a block that has not yet been proven. +type UnprovenBlock struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Block []byte `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` +} + +func (m *UnprovenBlock) Reset() { *m = UnprovenBlock{} } +func (m *UnprovenBlock) String() string { return proto.CompactTextString(m) } +func (*UnprovenBlock) ProtoMessage() {} +func (*UnprovenBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_c10129946240d9b3, []int{2} +} +func (m *UnprovenBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnprovenBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnprovenBlock.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 *UnprovenBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnprovenBlock.Merge(m, src) +} +func (m *UnprovenBlock) XXX_Size() int { + return m.Size() +} +func (m *UnprovenBlock) XXX_DiscardUnknown() { + xxx_messageInfo_UnprovenBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_UnprovenBlock proto.InternalMessageInfo + +func (m *UnprovenBlock) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *UnprovenBlock) GetBlock() []byte { + if m != nil { + return m.Block + } + return nil +} + +func init() { + proto.RegisterType((*InjectedData)(nil), "cada.v1beta1.InjectedData") + proto.RegisterType((*PendingBlocks)(nil), "cada.v1beta1.PendingBlocks") + proto.RegisterType((*UnprovenBlock)(nil), "cada.v1beta1.UnprovenBlock") +} + +func init() { proto.RegisterFile("cada/v1beta1/abci.proto", fileDescriptor_c10129946240d9b3) } + +var fileDescriptor_c10129946240d9b3 = []byte{ + // 278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0x4e, 0x4c, 0x49, + 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4c, 0x4a, 0xce, 0xd4, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0x49, 0xe8, 0x41, 0x25, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, + 0xc1, 0x12, 0xfa, 0x20, 0x16, 0x44, 0x8d, 0x52, 0x04, 0x17, 0x8f, 0x67, 0x5e, 0x56, 0x6a, 0x72, + 0x49, 0x6a, 0x8a, 0x4b, 0x62, 0x49, 0xa2, 0x90, 0x07, 0x17, 0x5f, 0x41, 0x6a, 0x5e, 0x4a, 0x66, + 0x5e, 0x7a, 0x7c, 0x52, 0x4e, 0x7e, 0x72, 0x76, 0xb1, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, + 0xb4, 0x1e, 0xb2, 0x61, 0x7a, 0x01, 0x10, 0x35, 0x4e, 0x60, 0x25, 0x4e, 0x2c, 0x27, 0xee, 0xc9, + 0x33, 0x04, 0xf1, 0x16, 0x20, 0x0b, 0x2a, 0x99, 0x70, 0xf1, 0xa2, 0xa8, 0x12, 0x52, 0xe6, 0xe2, + 0x05, 0x1b, 0x19, 0x9f, 0x91, 0x9a, 0x99, 0x9e, 0x51, 0x02, 0x32, 0x99, 0x59, 0x83, 0x39, 0x88, + 0x07, 0x2c, 0xe8, 0x01, 0x11, 0x53, 0xb2, 0xe5, 0xe2, 0x0d, 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0x4b, + 0xcd, 0x03, 0x6b, 0x13, 0x12, 0xe3, 0x62, 0x83, 0xa8, 0x07, 0x3b, 0x84, 0x39, 0x08, 0xca, 0x13, + 0x12, 0xe1, 0x62, 0x05, 0x6b, 0x94, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x09, 0x82, 0x70, 0x9c, 0x1c, + 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, + 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x3d, 0x3d, 0xb3, 0x24, 0xa3, + 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xbf, 0x2c, 0xb3, 0xa4, 0x3c, 0xb3, 0x44, 0x3f, 0xb1, 0x2c, + 0x31, 0x33, 0x47, 0x37, 0x25, 0x51, 0x37, 0x37, 0x3f, 0xa5, 0x34, 0x27, 0x55, 0xbf, 0xa4, 0xb2, + 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x30, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xe3, + 0x83, 0xee, 0x57, 0x01, 0x00, 0x00, +} + +func (m *InjectedData) 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 *InjectedData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InjectedData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PendingBlocks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PendingBlocks) 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 *PendingBlocks) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PendingBlocks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlockHeights) > 0 { + dAtA3 := make([]byte, len(m.BlockHeights)*10) + var j2 int + for _, num1 := range m.BlockHeights { + num := uint64(num1) + for num >= 1<<7 { + dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j2++ + } + dAtA3[j2] = uint8(num) + j2++ + } + i -= j2 + copy(dAtA[i:], dAtA3[:j2]) + i = encodeVarintAbci(dAtA, i, uint64(j2)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UnprovenBlock) 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 *UnprovenBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnprovenBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Block) > 0 { + i -= len(m.Block) + copy(dAtA[i:], m.Block) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Block))) + i-- + dAtA[i] = 0x12 + } + if m.Height != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAbci(dAtA []byte, offset int, v uint64) int { + offset -= sovAbci(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *InjectedData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PendingBlocks.Size() + n += 1 + l + sovAbci(uint64(l)) + return n +} + +func (m *PendingBlocks) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BlockHeights) > 0 { + l = 0 + for _, e := range m.BlockHeights { + l += sovAbci(uint64(e)) + } + n += 1 + sovAbci(uint64(l)) + l + } + return n +} + +func (m *UnprovenBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovAbci(uint64(m.Height)) + } + l = len(m.Block) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + return n +} + +func sovAbci(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAbci(x uint64) (n int) { + return sovAbci(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *InjectedData) 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: InjectedData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InjectedData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PendingBlocks", 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 + } + if err := m.PendingBlocks.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 (m *PendingBlocks) 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: PendingBlocks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PendingBlocks: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BlockHeights = append(m.BlockHeights, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.BlockHeights) == 0 { + m.BlockHeights = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BlockHeights = append(m.BlockHeights, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeights", wireType) + } + 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 (m *UnprovenBlock) 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: UnprovenBlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnprovenBlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Block = append(m.Block[:0], dAtA[iNdEx:postIndex]...) + if m.Block == nil { + m.Block = []byte{} + } + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAbci + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAbci + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAbci + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAbci + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAbci + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAbci + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAbci = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAbci = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAbci = fmt.Errorf("proto: unexpected end of group") +) diff --git a/types/genesis.pb.go b/types/genesis.pb.go new file mode 100644 index 0000000..9b74616 --- /dev/null +++ b/types/genesis.pb.go @@ -0,0 +1,263 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cada/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the avail da module's genesis state. +type GenesisState struct { +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_add756a79c56de92, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func init() { + proto.RegisterType((*GenesisState)(nil), "cada.v1beta1.GenesisState") +} + +func init() { proto.RegisterFile("cada/v1beta1/genesis.proto", fileDescriptor_add756a79c56de92) } + +var fileDescriptor_add756a79c56de92 = []byte{ + // 144 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0x4e, 0x4c, 0x49, + 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0xc9, 0xe9, 0x41, 0xe5, 0x94, 0xf8, 0xb8, + 0x78, 0xdc, 0x21, 0xd2, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x4e, 0x8e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, + 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, + 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9e, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, + 0xab, 0x5f, 0x96, 0x59, 0x52, 0x9e, 0x59, 0xa2, 0x9f, 0x58, 0x96, 0x98, 0x99, 0xa3, 0x9b, 0x92, + 0xa8, 0x9b, 0x9b, 0x9f, 0x52, 0x9a, 0x93, 0xaa, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, + 0xb6, 0xc7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xa2, 0xb6, 0xea, 0x85, 0x00, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/types/query.pb.go b/types/query.pb.go new file mode 100644 index 0000000..d30b2cb --- /dev/null +++ b/types/query.pb.go @@ -0,0 +1,690 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cada/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QuerySubmitBlobStatusRequest is the request type for the SubmitBlobStatus RPC method. +type QuerySubmittedBlobStatusRequest struct { +} + +func (m *QuerySubmittedBlobStatusRequest) Reset() { *m = QuerySubmittedBlobStatusRequest{} } +func (m *QuerySubmittedBlobStatusRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySubmittedBlobStatusRequest) ProtoMessage() {} +func (*QuerySubmittedBlobStatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0579d66f58f8318a, []int{0} +} +func (m *QuerySubmittedBlobStatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySubmittedBlobStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySubmittedBlobStatusRequest.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 *QuerySubmittedBlobStatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubmittedBlobStatusRequest.Merge(m, src) +} +func (m *QuerySubmittedBlobStatusRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySubmittedBlobStatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubmittedBlobStatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySubmittedBlobStatusRequest proto.InternalMessageInfo + +// QuerySubmitBlobStatusResponse is the response type for the SubmitBlobStatus RPC method. +type QuerySubmittedBlobStatusResponse struct { + // range specifies the range of blocks that are being submitted. + // It contains information about the starting and ending block heights. + Range *Range `protobuf:"bytes,1,opt,name=range,proto3" json:"range,omitempty"` + // status indicates the current status of the blob submission. + // Possible values might include statuses like "pending", "in_voting", "success", or "failure". + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + // proven_height represents the height up to which data has been successfully proven. + // This height indicates the extent of posted data to avail light client. + ProvenHeight uint64 `protobuf:"varint,3,opt,name=proven_height,json=provenHeight,proto3" json:"proven_height,omitempty"` + // voting_ends_at denotes the block height at which the last voting on the blob ended. + // This provides information on when the last voting period for the blob concluded. + VotingEndsAt string `protobuf:"bytes,4,opt,name=voting_ends_at,json=votingEndsAt,proto3" json:"voting_ends_at,omitempty"` +} + +func (m *QuerySubmittedBlobStatusResponse) Reset() { *m = QuerySubmittedBlobStatusResponse{} } +func (m *QuerySubmittedBlobStatusResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySubmittedBlobStatusResponse) ProtoMessage() {} +func (*QuerySubmittedBlobStatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0579d66f58f8318a, []int{1} +} +func (m *QuerySubmittedBlobStatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySubmittedBlobStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySubmittedBlobStatusResponse.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 *QuerySubmittedBlobStatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySubmittedBlobStatusResponse.Merge(m, src) +} +func (m *QuerySubmittedBlobStatusResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySubmittedBlobStatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySubmittedBlobStatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySubmittedBlobStatusResponse proto.InternalMessageInfo + +func (m *QuerySubmittedBlobStatusResponse) GetRange() *Range { + if m != nil { + return m.Range + } + return nil +} + +func (m *QuerySubmittedBlobStatusResponse) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *QuerySubmittedBlobStatusResponse) GetProvenHeight() uint64 { + if m != nil { + return m.ProvenHeight + } + return 0 +} + +func (m *QuerySubmittedBlobStatusResponse) GetVotingEndsAt() string { + if m != nil { + return m.VotingEndsAt + } + return "" +} + +func init() { + proto.RegisterType((*QuerySubmittedBlobStatusRequest)(nil), "cada.v1beta1.QuerySubmittedBlobStatusRequest") + proto.RegisterType((*QuerySubmittedBlobStatusResponse)(nil), "cada.v1beta1.QuerySubmittedBlobStatusResponse") +} + +func init() { proto.RegisterFile("cada/v1beta1/query.proto", fileDescriptor_0579d66f58f8318a) } + +var fileDescriptor_0579d66f58f8318a = []byte{ + // 357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0xcd, 0x4a, 0xeb, 0x40, + 0x14, 0xee, 0xf4, 0xb6, 0x85, 0x3b, 0xb7, 0xf7, 0x2e, 0xa6, 0x5c, 0x09, 0x45, 0x62, 0x6c, 0x15, + 0x2b, 0xd2, 0x84, 0xd6, 0x27, 0x68, 0x41, 0x70, 0x6b, 0xba, 0x73, 0x53, 0x66, 0x9a, 0x21, 0x1d, + 0x48, 0x67, 0xd2, 0xcc, 0x49, 0xb4, 0x5b, 0x9f, 0x40, 0xf0, 0x09, 0x5c, 0xbb, 0xf1, 0x31, 0x5c, + 0x16, 0xdc, 0xb8, 0x94, 0xd6, 0x07, 0x91, 0x66, 0x8a, 0x5a, 0x50, 0x74, 0x79, 0xbe, 0x3f, 0x3e, + 0xbe, 0x83, 0xad, 0x11, 0x0d, 0xa8, 0x97, 0x75, 0x18, 0x07, 0xda, 0xf1, 0xa6, 0x29, 0x4f, 0x66, + 0x6e, 0x9c, 0x28, 0x50, 0xa4, 0xba, 0x62, 0xdc, 0x35, 0x53, 0xdf, 0x0e, 0x95, 0x0a, 0x23, 0xee, + 0xd1, 0x58, 0x78, 0x54, 0x4a, 0x05, 0x14, 0x84, 0x92, 0xda, 0x68, 0xeb, 0xff, 0x37, 0x52, 0xe0, + 0xd2, 0xc0, 0x8d, 0x5d, 0xbc, 0x73, 0xb6, 0x4a, 0x1c, 0xa4, 0x6c, 0x22, 0x00, 0x78, 0xd0, 0x8f, + 0x14, 0x1b, 0x00, 0x85, 0x54, 0xfb, 0x7c, 0x9a, 0x72, 0x0d, 0x8d, 0x7b, 0x84, 0x9d, 0xaf, 0x35, + 0x3a, 0x56, 0x52, 0x73, 0x72, 0x88, 0xcb, 0x09, 0x95, 0x21, 0xb7, 0x90, 0x83, 0x5a, 0x7f, 0xba, + 0x35, 0xf7, 0x63, 0x35, 0xd7, 0x5f, 0x51, 0xbe, 0x51, 0x90, 0x2d, 0x5c, 0xd1, 0xb9, 0xd9, 0x2a, + 0x3a, 0xa8, 0xf5, 0xdb, 0x5f, 0x5f, 0xa4, 0x89, 0xff, 0xc6, 0x89, 0xca, 0xb8, 0x1c, 0x8e, 0xb9, + 0x08, 0xc7, 0x60, 0xfd, 0x72, 0x50, 0xab, 0xe4, 0x57, 0x0d, 0x78, 0x9a, 0x63, 0x64, 0x0f, 0xff, + 0xcb, 0x14, 0x08, 0x19, 0x0e, 0xb9, 0x0c, 0xf4, 0x90, 0x82, 0x55, 0xca, 0x43, 0xaa, 0x06, 0x3d, + 0x91, 0x81, 0xee, 0x41, 0xf7, 0x0e, 0xe1, 0x72, 0x5e, 0x99, 0xdc, 0x22, 0x5c, 0xfb, 0xa4, 0x37, + 0x69, 0x6f, 0x16, 0xfc, 0x66, 0x83, 0xba, 0xfb, 0x53, 0xb9, 0x99, 0xa3, 0x71, 0x74, 0xf5, 0xf8, + 0x72, 0x53, 0xdc, 0x27, 0x4d, 0x8f, 0x66, 0x54, 0x44, 0x2c, 0x52, 0xec, 0x6d, 0x7b, 0x9d, 0xfb, + 0xde, 0x4d, 0xfd, 0xde, 0xc3, 0xc2, 0x46, 0xf3, 0x85, 0x8d, 0x9e, 0x17, 0x36, 0xba, 0x5e, 0xda, + 0x85, 0xf9, 0xd2, 0x2e, 0x3c, 0x2d, 0xed, 0xc2, 0xf9, 0x41, 0x28, 0x60, 0x9c, 0x32, 0x77, 0xa4, + 0x26, 0x5e, 0x26, 0xe0, 0x42, 0x80, 0xc9, 0x6b, 0x07, 0xb4, 0x3d, 0x51, 0x41, 0x1a, 0x71, 0x0f, + 0x66, 0x31, 0xd7, 0xac, 0x92, 0x7f, 0xf3, 0xf8, 0x35, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x69, 0xec, + 0x0a, 0x2c, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // SubmitBlobStatus queries the current status of blob submissions. + SubmittedBlobStatus(ctx context.Context, in *QuerySubmittedBlobStatusRequest, opts ...grpc.CallOption) (*QuerySubmittedBlobStatusResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) SubmittedBlobStatus(ctx context.Context, in *QuerySubmittedBlobStatusRequest, opts ...grpc.CallOption) (*QuerySubmittedBlobStatusResponse, error) { + out := new(QuerySubmittedBlobStatusResponse) + err := c.cc.Invoke(ctx, "/cada.v1beta1.Query/SubmittedBlobStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // SubmitBlobStatus queries the current status of blob submissions. + SubmittedBlobStatus(context.Context, *QuerySubmittedBlobStatusRequest) (*QuerySubmittedBlobStatusResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) SubmittedBlobStatus(ctx context.Context, req *QuerySubmittedBlobStatusRequest) (*QuerySubmittedBlobStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmittedBlobStatus not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_SubmittedBlobStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySubmittedBlobStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SubmittedBlobStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cada.v1beta1.Query/SubmittedBlobStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SubmittedBlobStatus(ctx, req.(*QuerySubmittedBlobStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cada.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmittedBlobStatus", + Handler: _Query_SubmittedBlobStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cada/v1beta1/query.proto", +} + +func (m *QuerySubmittedBlobStatusRequest) 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 *QuerySubmittedBlobStatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySubmittedBlobStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QuerySubmittedBlobStatusResponse) 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 *QuerySubmittedBlobStatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySubmittedBlobStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VotingEndsAt) > 0 { + i -= len(m.VotingEndsAt) + copy(dAtA[i:], m.VotingEndsAt) + i = encodeVarintQuery(dAtA, i, uint64(len(m.VotingEndsAt))) + i-- + dAtA[i] = 0x22 + } + if m.ProvenHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProvenHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x12 + } + if m.Range != nil { + { + size, err := m.Range.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QuerySubmittedBlobStatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QuerySubmittedBlobStatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Range != nil { + l = m.Range.Size() + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Status) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ProvenHeight != 0 { + n += 1 + sovQuery(uint64(m.ProvenHeight)) + } + l = len(m.VotingEndsAt) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QuerySubmittedBlobStatusRequest) 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 ErrIntOverflowQuery + } + 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: QuerySubmittedBlobStatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySubmittedBlobStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySubmittedBlobStatusResponse) 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 ErrIntOverflowQuery + } + 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: QuerySubmittedBlobStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySubmittedBlobStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Range == nil { + m.Range = &Range{} + } + if err := m.Range.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProvenHeight", wireType) + } + m.ProvenHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProvenHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingEndsAt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VotingEndsAt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/types/query.pb.gw.go b/types/query.pb.gw.go new file mode 100644 index 0000000..800b835 --- /dev/null +++ b/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cada/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_SubmittedBlobStatus_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubmittedBlobStatusRequest + var metadata runtime.ServerMetadata + + msg, err := client.SubmittedBlobStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SubmittedBlobStatus_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySubmittedBlobStatusRequest + var metadata runtime.ServerMetadata + + msg, err := server.SubmittedBlobStatus(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_SubmittedBlobStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SubmittedBlobStatus_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SubmittedBlobStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_SubmittedBlobStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SubmittedBlobStatus_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SubmittedBlobStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_SubmittedBlobStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"availblob", "v1beta1", "submitBlobStatus"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_SubmittedBlobStatus_0 = runtime.ForwardResponseMessage +) diff --git a/types/tx.pb.go b/types/tx.pb.go new file mode 100644 index 0000000..09da3f0 --- /dev/null +++ b/types/tx.pb.go @@ -0,0 +1,912 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cada/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// BlobStatus defines the statuses for a blob submission +type BlobStatus int32 + +const ( + // Indicates that the blob status is unspecified or not set. + BLOB_STATUS_UNSPECIFIED BlobStatus = 0 + // Indicates that the blob submission failed. + BLOB_STATUS_FAILURE BlobStatus = 1 + // Indicates that the blob submission was successful. + BLOB_STATUS_SUCCESS BlobStatus = 2 + // Indicates that the blob submission is still pending and has not yet been processed. + BLOB_STATUS_PENDING BlobStatus = 3 +) + +var BlobStatus_name = map[int32]string{ + 0: "BLOB_STATUS_UNSPECIFIED", + 1: "BLOB_STATUS_FAILURE", + 2: "BLOB_STATUS_SUCCESS", + 3: "BLOB_STATUS_PENDING", +} + +var BlobStatus_value = map[string]int32{ + "BLOB_STATUS_UNSPECIFIED": 0, + "BLOB_STATUS_FAILURE": 1, + "BLOB_STATUS_SUCCESS": 2, + "BLOB_STATUS_PENDING": 3, +} + +func (x BlobStatus) String() string { + return proto.EnumName(BlobStatus_name, int32(x)) +} + +func (BlobStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_c917a06c648c4256, []int{0} +} + +// Range defines the range of blocks for which the blob is being submitted. +type Range struct { + // The starting block height in the range. Indicates the beginning of the block range. + From uint64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"` + // The ending block height in the range. Indicates the end of the block range. + To uint64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"` +} + +func (m *Range) Reset() { *m = Range{} } +func (m *Range) String() string { return proto.CompactTextString(m) } +func (*Range) ProtoMessage() {} +func (*Range) Descriptor() ([]byte, []int) { + return fileDescriptor_c917a06c648c4256, []int{0} +} +func (m *Range) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Range.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 *Range) XXX_Merge(src proto.Message) { + xxx_messageInfo_Range.Merge(m, src) +} +func (m *Range) XXX_Size() int { + return m.Size() +} +func (m *Range) XXX_DiscardUnknown() { + xxx_messageInfo_Range.DiscardUnknown(m) +} + +var xxx_messageInfo_Range proto.InternalMessageInfo + +func (m *Range) GetFrom() uint64 { + if m != nil { + return m.From + } + return 0 +} + +func (m *Range) GetTo() uint64 { + if m != nil { + return m.To + } + return 0 +} + +// MsgUpdateBlobStatusRequest define a message to update the status of a previously submitted blob. +type MsgUpdateBlobStatusRequest struct { + // Address of the validator updating the blob status. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // range of blocks for which the blob status is being updated. + BlocksRange *Range `protobuf:"bytes,2,opt,name=blocks_range,json=blocksRange,proto3" json:"blocks_range,omitempty"` + // The height at which the blob is stored in the Avail system. This indicates where the blob data is available. + AvailHeight uint64 `protobuf:"varint,3,opt,name=avail_height,json=availHeight,proto3" json:"avail_height,omitempty"` + // The status of the blob submission. + IsSuccess bool `protobuf:"varint,4,opt,name=is_success,json=isSuccess,proto3" json:"is_success,omitempty"` +} + +func (m *MsgUpdateBlobStatusRequest) Reset() { *m = MsgUpdateBlobStatusRequest{} } +func (m *MsgUpdateBlobStatusRequest) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateBlobStatusRequest) ProtoMessage() {} +func (*MsgUpdateBlobStatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c917a06c648c4256, []int{1} +} +func (m *MsgUpdateBlobStatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateBlobStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateBlobStatusRequest.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 *MsgUpdateBlobStatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateBlobStatusRequest.Merge(m, src) +} +func (m *MsgUpdateBlobStatusRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateBlobStatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateBlobStatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateBlobStatusRequest proto.InternalMessageInfo + +func (m *MsgUpdateBlobStatusRequest) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +func (m *MsgUpdateBlobStatusRequest) GetBlocksRange() *Range { + if m != nil { + return m.BlocksRange + } + return nil +} + +func (m *MsgUpdateBlobStatusRequest) GetAvailHeight() uint64 { + if m != nil { + return m.AvailHeight + } + return 0 +} + +func (m *MsgUpdateBlobStatusRequest) GetIsSuccess() bool { + if m != nil { + return m.IsSuccess + } + return false +} + +// MsgUpdateBlobStatusResponse is the response type for the Msg/UpdateBlobStatus RPC method. +type MsgUpdateBlobStatusResponse struct { +} + +func (m *MsgUpdateBlobStatusResponse) Reset() { *m = MsgUpdateBlobStatusResponse{} } +func (m *MsgUpdateBlobStatusResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateBlobStatusResponse) ProtoMessage() {} +func (*MsgUpdateBlobStatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c917a06c648c4256, []int{2} +} +func (m *MsgUpdateBlobStatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateBlobStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateBlobStatusResponse.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 *MsgUpdateBlobStatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateBlobStatusResponse.Merge(m, src) +} +func (m *MsgUpdateBlobStatusResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateBlobStatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateBlobStatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateBlobStatusResponse proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("cada.v1beta1.BlobStatus", BlobStatus_name, BlobStatus_value) + proto.RegisterType((*Range)(nil), "cada.v1beta1.Range") + proto.RegisterType((*MsgUpdateBlobStatusRequest)(nil), "cada.v1beta1.MsgUpdateBlobStatusRequest") + proto.RegisterType((*MsgUpdateBlobStatusResponse)(nil), "cada.v1beta1.MsgUpdateBlobStatusResponse") +} + +func init() { proto.RegisterFile("cada/v1beta1/tx.proto", fileDescriptor_c917a06c648c4256) } + +var fileDescriptor_c917a06c648c4256 = []byte{ + // 464 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xed, 0x24, 0x45, 0x74, 0x12, 0x21, 0xb3, 0x05, 0x12, 0xb9, 0xaa, 0x55, 0x72, 0x21, + 0xa4, 0xaa, 0xad, 0x14, 0x89, 0x03, 0xb7, 0x24, 0x75, 0x21, 0x52, 0x1b, 0x2a, 0xbb, 0xbe, 0x70, + 0xb1, 0xd6, 0xf6, 0xb2, 0xb1, 0xb0, 0xbb, 0xc1, 0xbb, 0x36, 0x7f, 0x4e, 0x88, 0x13, 0x47, 0xde, + 0x81, 0x17, 0xe8, 0x63, 0x70, 0xec, 0x11, 0x89, 0x0b, 0x4a, 0x0e, 0x7d, 0x0d, 0xe4, 0x35, 0x82, + 0x10, 0x40, 0xe2, 0xb4, 0xa3, 0xdf, 0x37, 0xda, 0xf9, 0xbe, 0x9d, 0x85, 0xdb, 0x21, 0x8e, 0xb0, + 0x55, 0x0c, 0x02, 0x22, 0xf0, 0xc0, 0x12, 0xaf, 0xcd, 0x79, 0xc6, 0x04, 0x43, 0xad, 0x12, 0x9b, + 0x3f, 0xb0, 0xde, 0x0e, 0x19, 0x4f, 0x19, 0xb7, 0x52, 0x4e, 0xad, 0x62, 0x50, 0x1e, 0x55, 0x9b, + 0x7e, 0x8b, 0x32, 0xca, 0x64, 0x69, 0x95, 0x55, 0x45, 0xbb, 0x7b, 0xb0, 0xe1, 0xe0, 0x73, 0x4a, + 0x10, 0x82, 0xc6, 0xf3, 0x8c, 0xa5, 0x1d, 0x75, 0x57, 0xed, 0x35, 0x1c, 0x59, 0xa3, 0x1b, 0x50, + 0x13, 0xac, 0x53, 0x93, 0xa4, 0x26, 0x58, 0xf7, 0xab, 0x0a, 0xfa, 0x09, 0xa7, 0xde, 0x3c, 0xc2, + 0x82, 0x8c, 0x12, 0x16, 0xb8, 0x02, 0x8b, 0x9c, 0x3b, 0xe4, 0x65, 0x4e, 0xb8, 0x40, 0x7b, 0x70, + 0xb3, 0xc0, 0x49, 0x1c, 0x61, 0xc1, 0x32, 0x1f, 0x47, 0x51, 0x46, 0x38, 0x97, 0xf7, 0x6d, 0x3a, + 0xda, 0x4f, 0x61, 0x58, 0x71, 0xf4, 0x10, 0x5a, 0x41, 0xc2, 0xc2, 0x17, 0xdc, 0xcf, 0xca, 0xf9, + 0x72, 0x4a, 0xf3, 0x60, 0xcb, 0x5c, 0x0d, 0x63, 0x4a, 0x6b, 0x4e, 0xb3, 0x6a, 0xac, 0x7c, 0xde, + 0x85, 0x16, 0x2e, 0x70, 0x9c, 0xf8, 0x33, 0x12, 0xd3, 0x99, 0xe8, 0xd4, 0xa5, 0xbb, 0xa6, 0x64, + 0x4f, 0x24, 0x42, 0x3b, 0x00, 0x31, 0xf7, 0x79, 0x1e, 0x86, 0xa5, 0x81, 0xc6, 0xae, 0xda, 0xbb, + 0xee, 0x6c, 0xc6, 0xdc, 0xad, 0xc0, 0xa3, 0x3b, 0xef, 0xaf, 0x2e, 0xfa, 0x7f, 0x3a, 0xed, 0xee, + 0xc0, 0xf6, 0x5f, 0xc3, 0xf1, 0x39, 0x3b, 0xe7, 0xa4, 0xff, 0x16, 0xe0, 0x17, 0x45, 0xdb, 0xd0, + 0x1e, 0x1d, 0x3f, 0x1d, 0xf9, 0xee, 0xd9, 0xf0, 0xcc, 0x73, 0x7d, 0x6f, 0xea, 0x9e, 0xda, 0xe3, + 0xc9, 0xd1, 0xc4, 0x3e, 0xd4, 0x14, 0xd4, 0x86, 0xad, 0x55, 0xf1, 0x68, 0x38, 0x39, 0xf6, 0x1c, + 0x5b, 0x53, 0xd7, 0x05, 0xd7, 0x1b, 0x8f, 0x6d, 0xd7, 0xd5, 0x6a, 0xeb, 0xc2, 0xa9, 0x3d, 0x3d, + 0x9c, 0x4c, 0x1f, 0x6b, 0x75, 0xbd, 0xf1, 0xe1, 0x93, 0xa1, 0x1c, 0xe4, 0x50, 0x3f, 0xe1, 0x14, + 0x51, 0xd0, 0xd6, 0xed, 0xa1, 0xde, 0xef, 0x2f, 0xf6, 0xef, 0xf5, 0xe8, 0xf7, 0xff, 0xa3, 0xb3, + 0xca, 0xaa, 0x6f, 0xbc, 0xbb, 0xba, 0xe8, 0xab, 0xa3, 0xe1, 0xe7, 0x85, 0xa1, 0x5e, 0x2e, 0x0c, + 0xf5, 0xdb, 0xc2, 0x50, 0x3f, 0x2e, 0x0d, 0xe5, 0x72, 0x69, 0x28, 0x5f, 0x96, 0x86, 0xf2, 0xec, + 0x1e, 0x8d, 0xc5, 0x2c, 0x0f, 0xcc, 0x90, 0xa5, 0x56, 0x11, 0x8b, 0x57, 0xb1, 0xb0, 0xe4, 0x06, + 0xf6, 0x23, 0xbc, 0x9f, 0xb2, 0x28, 0x4f, 0x88, 0x25, 0xde, 0xcc, 0x09, 0x0f, 0xae, 0xc9, 0x6f, + 0xf6, 0xe0, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xd1, 0x7e, 0xdd, 0xbc, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateBlobStatus updates the status of a blob submission. + UpdateBlobStatus(ctx context.Context, in *MsgUpdateBlobStatusRequest, opts ...grpc.CallOption) (*MsgUpdateBlobStatusResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateBlobStatus(ctx context.Context, in *MsgUpdateBlobStatusRequest, opts ...grpc.CallOption) (*MsgUpdateBlobStatusResponse, error) { + out := new(MsgUpdateBlobStatusResponse) + err := c.cc.Invoke(ctx, "/cada.v1beta1.Msg/UpdateBlobStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateBlobStatus updates the status of a blob submission. + UpdateBlobStatus(context.Context, *MsgUpdateBlobStatusRequest) (*MsgUpdateBlobStatusResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateBlobStatus(ctx context.Context, req *MsgUpdateBlobStatusRequest) (*MsgUpdateBlobStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBlobStatus not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateBlobStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateBlobStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateBlobStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cada.v1beta1.Msg/UpdateBlobStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateBlobStatus(ctx, req.(*MsgUpdateBlobStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cada.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateBlobStatus", + Handler: _Msg_UpdateBlobStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cada/v1beta1/tx.proto", +} + +func (m *Range) 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 *Range) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Range) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.To != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.To)) + i-- + dAtA[i] = 0x10 + } + if m.From != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.From)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateBlobStatusRequest) 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 *MsgUpdateBlobStatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateBlobStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsSuccess { + i-- + if m.IsSuccess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.AvailHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AvailHeight)) + i-- + dAtA[i] = 0x18 + } + if m.BlocksRange != nil { + { + size, err := m.BlocksRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateBlobStatusResponse) 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 *MsgUpdateBlobStatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateBlobStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Range) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.From != 0 { + n += 1 + sovTx(uint64(m.From)) + } + if m.To != 0 { + n += 1 + sovTx(uint64(m.To)) + } + return n +} + +func (m *MsgUpdateBlobStatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BlocksRange != nil { + l = m.BlocksRange.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.AvailHeight != 0 { + n += 1 + sovTx(uint64(m.AvailHeight)) + } + if m.IsSuccess { + n += 2 + } + return n +} + +func (m *MsgUpdateBlobStatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Range) 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 ErrIntOverflowTx + } + 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: Range: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Range: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + m.From = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.From |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + m.To = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.To |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateBlobStatusRequest) 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 ErrIntOverflowTx + } + 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: MsgUpdateBlobStatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateBlobStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksRange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlocksRange == nil { + m.BlocksRange = &Range{} + } + if err := m.BlocksRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AvailHeight", wireType) + } + m.AvailHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AvailHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsSuccess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsSuccess = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateBlobStatusResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateBlobStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateBlobStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/types/vote_extensions.pb.go b/types/vote_extensions.pb.go new file mode 100644 index 0000000..7556687 --- /dev/null +++ b/types/vote_extensions.pb.go @@ -0,0 +1,367 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cada/v1beta1/vote_extensions.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// AvailVoteExtension defines the info which includes in vote extensions +type AvailVoteExtension struct { + // avail_height specifies the height in the Avail chain at which the data has been posted. + AvailHeight int64 `protobuf:"varint,1,opt,name=avail_height,json=availHeight,proto3" json:"avail_height,omitempty"` + // range defines the range of blocks that have been posted to the Avail Data Availability (DA) layer. + Range *Range `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"` +} + +func (m *AvailVoteExtension) Reset() { *m = AvailVoteExtension{} } +func (m *AvailVoteExtension) String() string { return proto.CompactTextString(m) } +func (*AvailVoteExtension) ProtoMessage() {} +func (*AvailVoteExtension) Descriptor() ([]byte, []int) { + return fileDescriptor_194cb859e020afeb, []int{0} +} +func (m *AvailVoteExtension) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AvailVoteExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AvailVoteExtension.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 *AvailVoteExtension) XXX_Merge(src proto.Message) { + xxx_messageInfo_AvailVoteExtension.Merge(m, src) +} +func (m *AvailVoteExtension) XXX_Size() int { + return m.Size() +} +func (m *AvailVoteExtension) XXX_DiscardUnknown() { + xxx_messageInfo_AvailVoteExtension.DiscardUnknown(m) +} + +var xxx_messageInfo_AvailVoteExtension proto.InternalMessageInfo + +func (m *AvailVoteExtension) GetAvailHeight() int64 { + if m != nil { + return m.AvailHeight + } + return 0 +} + +func (m *AvailVoteExtension) GetRange() *Range { + if m != nil { + return m.Range + } + return nil +} + +func init() { + proto.RegisterType((*AvailVoteExtension)(nil), "cada.v1beta1.AvailVoteExtension") +} + +func init() { + proto.RegisterFile("cada/v1beta1/vote_extensions.proto", fileDescriptor_194cb859e020afeb) +} + +var fileDescriptor_194cb859e020afeb = []byte{ + // 216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0x4e, 0x4c, 0x49, + 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xcb, 0x2f, 0x49, 0x8d, 0x4f, 0xad, + 0x28, 0x49, 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, + 0x01, 0xa9, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x45, 0xd1, 0x51, 0x52, 0x01, 0x51, 0xa4, 0x94, 0xc4, + 0x25, 0xe4, 0x58, 0x96, 0x98, 0x99, 0x13, 0x96, 0x5f, 0x92, 0xea, 0x0a, 0x33, 0x41, 0x48, 0x91, + 0x8b, 0x27, 0x11, 0x24, 0x1a, 0x9f, 0x91, 0x9a, 0x99, 0x9e, 0x51, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, + 0xc1, 0x1c, 0xc4, 0x0d, 0x16, 0xf3, 0x00, 0x0b, 0x09, 0x69, 0x72, 0xb1, 0x16, 0x25, 0xe6, 0xa5, + 0xa7, 0x4a, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0x09, 0xeb, 0x21, 0xdb, 0xa6, 0x17, 0x04, 0x92, + 0x0a, 0x82, 0xa8, 0x70, 0x72, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, + 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, + 0xf5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xb2, 0xcc, 0x92, 0xf2, + 0xcc, 0x12, 0x7d, 0xb0, 0x1d, 0xba, 0x29, 0x89, 0xba, 0xb9, 0xf9, 0x29, 0xa5, 0x39, 0xa9, 0xfa, + 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xd7, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x08, 0x21, 0x4f, 0xd7, 0xf8, 0x00, 0x00, 0x00, +} + +func (m *AvailVoteExtension) 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 *AvailVoteExtension) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AvailVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Range != nil { + { + size, err := m.Range.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVoteExtensions(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.AvailHeight != 0 { + i = encodeVarintVoteExtensions(dAtA, i, uint64(m.AvailHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintVoteExtensions(dAtA []byte, offset int, v uint64) int { + offset -= sovVoteExtensions(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AvailVoteExtension) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AvailHeight != 0 { + n += 1 + sovVoteExtensions(uint64(m.AvailHeight)) + } + if m.Range != nil { + l = m.Range.Size() + n += 1 + l + sovVoteExtensions(uint64(l)) + } + return n +} + +func sovVoteExtensions(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozVoteExtensions(x uint64) (n int) { + return sovVoteExtensions(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AvailVoteExtension) 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 ErrIntOverflowVoteExtensions + } + 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: AvailVoteExtension: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AvailVoteExtension: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AvailHeight", wireType) + } + m.AvailHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoteExtensions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AvailHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVoteExtensions + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVoteExtensions + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVoteExtensions + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Range == nil { + m.Range = &Range{} + } + if err := m.Range.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVoteExtensions(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthVoteExtensions + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipVoteExtensions(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowVoteExtensions + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowVoteExtensions + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowVoteExtensions + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthVoteExtensions + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupVoteExtensions + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthVoteExtensions + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthVoteExtensions = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowVoteExtensions = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupVoteExtensions = fmt.Errorf("proto: unexpected end of group") +)