From 5a618ba5634819e6fce97a1914d4b06ec633a4cd Mon Sep 17 00:00:00 2001 From: Eduard Voiculescu Date: Mon, 12 Aug 2024 08:53:42 -0400 Subject: [PATCH] realigning block proto fields --- pb/sf/gear/type/v1/block.pb.go | 76 ++++----- pb/sf/gear/type/v1/block_vtproto.pb.go | 216 ++++++++++++------------- proto/sf/gear/type/v1/block.proto | 20 +-- 3 files changed, 156 insertions(+), 156 deletions(-) diff --git a/pb/sf/gear/type/v1/block.pb.go b/pb/sf/gear/type/v1/block.pb.go index edc8a6f..38de78c 100644 --- a/pb/sf/gear/type/v1/block.pb.go +++ b/pb/sf/gear/type/v1/block.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.0 +// protoc-gen-go v1.28.1 // protoc (unknown) // source: sf/gear/type/v1/block.proto @@ -29,12 +29,12 @@ type Block struct { Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` Header *Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Extrinsics []*Extrinsic `protobuf:"bytes,6,rep,name=extrinsics,proto3" json:"extrinsics,omitempty"` - Events []*Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"` - DigestItems []*DigestItem `protobuf:"bytes,8,rep,name=digest_items,json=digestItems,proto3" json:"digest_items,omitempty"` - Justification []byte `protobuf:"bytes,9,opt,name=justification,proto3" json:"justification,omitempty"` - RawEvents []byte `protobuf:"bytes,10,opt,name=raw_events,json=rawEvents,proto3" json:"raw_events,omitempty"` + Extrinsics []*Extrinsic `protobuf:"bytes,4,rep,name=extrinsics,proto3" json:"extrinsics,omitempty"` + Events []*Event `protobuf:"bytes,5,rep,name=events,proto3" json:"events,omitempty"` + DigestItems []*DigestItem `protobuf:"bytes,6,rep,name=digest_items,json=digestItems,proto3" json:"digest_items,omitempty"` + Justification []byte `protobuf:"bytes,7,opt,name=justification,proto3" json:"justification,omitempty"` + RawEvents []byte `protobuf:"bytes,8,opt,name=raw_events,json=rawEvents,proto3" json:"raw_events,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } func (x *Block) Reset() { @@ -90,13 +90,6 @@ func (x *Block) GetHeader() *Header { return nil } -func (x *Block) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - func (x *Block) GetExtrinsics() []*Extrinsic { if x != nil { return x.Extrinsics @@ -132,6 +125,13 @@ func (x *Block) GetRawEvents() []byte { return nil } +func (x *Block) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + type Header struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1361,26 +1361,26 @@ var file_sf_gear_type_v1_block_proto_rawDesc = []byte{ 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x3a, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, - 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x73, 0x12, 0x2e, 0x0a, 0x06, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, - 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x0c, - 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, - 0x0b, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x24, 0x0a, 0x0d, - 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x61, 0x77, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x61, 0x77, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x22, 0xbf, 0x01, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, + 0x73, 0x69, 0x63, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x66, 0x2e, + 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, + 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, + 0x63, 0x73, 0x12, 0x2e, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, + 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0b, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x61, 0x77, 0x5f, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x61, + 0x77, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x22, 0xbf, 0x01, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, @@ -1582,10 +1582,10 @@ var file_sf_gear_type_v1_block_proto_goTypes = []interface{}{ } var file_sf_gear_type_v1_block_proto_depIdxs = []int32{ 1, // 0: sf.gear.type.v1.Block.header:type_name -> sf.gear.type.v1.Header - 18, // 1: sf.gear.type.v1.Block.timestamp:type_name -> google.protobuf.Timestamp - 7, // 2: sf.gear.type.v1.Block.extrinsics:type_name -> sf.gear.type.v1.Extrinsic - 14, // 3: sf.gear.type.v1.Block.events:type_name -> sf.gear.type.v1.Event - 2, // 4: sf.gear.type.v1.Block.digest_items:type_name -> sf.gear.type.v1.DigestItem + 7, // 1: sf.gear.type.v1.Block.extrinsics:type_name -> sf.gear.type.v1.Extrinsic + 14, // 2: sf.gear.type.v1.Block.events:type_name -> sf.gear.type.v1.Event + 2, // 3: sf.gear.type.v1.Block.digest_items:type_name -> sf.gear.type.v1.DigestItem + 18, // 4: sf.gear.type.v1.Block.timestamp:type_name -> google.protobuf.Timestamp 3, // 5: sf.gear.type.v1.DigestItem.as_pre_runtime:type_name -> sf.gear.type.v1.PreRuntime 4, // 6: sf.gear.type.v1.DigestItem.as_consensus:type_name -> sf.gear.type.v1.Consensus 5, // 7: sf.gear.type.v1.DigestItem.as_seal:type_name -> sf.gear.type.v1.Seal diff --git a/pb/sf/gear/type/v1/block_vtproto.pb.go b/pb/sf/gear/type/v1/block_vtproto.pb.go index c19441c..81016c1 100644 --- a/pb/sf/gear/type/v1/block_vtproto.pb.go +++ b/pb/sf/gear/type/v1/block_vtproto.pb.go @@ -560,9 +560,6 @@ func (this *Block) EqualVT(that *Block) bool { if !this.Header.EqualVT(that.Header) { return false } - if !(*timestamppb1.Timestamp)(this.Timestamp).EqualVT((*timestamppb1.Timestamp)(that.Timestamp)) { - return false - } if len(this.Extrinsics) != len(that.Extrinsics) { return false } @@ -620,6 +617,9 @@ func (this *Block) EqualVT(that *Block) bool { if string(this.RawEvents) != string(that.RawEvents) { return false } + if !(*timestamppb1.Timestamp)(this.Timestamp).EqualVT((*timestamppb1.Timestamp)(that.Timestamp)) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -1247,19 +1247,29 @@ func (m *Block) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.Timestamp != nil { + size, err := (*timestamppb1.Timestamp)(m.Timestamp).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } if len(m.RawEvents) > 0 { i -= len(m.RawEvents) copy(dAtA[i:], m.RawEvents) i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RawEvents))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x42 } if len(m.Justification) > 0 { i -= len(m.Justification) copy(dAtA[i:], m.Justification) i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Justification))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x3a } if len(m.DigestItems) > 0 { for iNdEx := len(m.DigestItems) - 1; iNdEx >= 0; iNdEx-- { @@ -1270,7 +1280,7 @@ func (m *Block) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x32 } } if len(m.Events) > 0 { @@ -1282,7 +1292,7 @@ func (m *Block) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x2a } } if len(m.Extrinsics) > 0 { @@ -1294,18 +1304,8 @@ func (m *Block) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x32 - } - } - if m.Timestamp != nil { - size, err := (*timestamppb1.Timestamp)(m.Timestamp).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0x22 } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x2a } if m.Header != nil { size, err := m.Header.MarshalToSizedBufferVT(dAtA[:i]) @@ -2467,19 +2467,29 @@ func (m *Block) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.Timestamp != nil { + size, err := (*timestamppb1.Timestamp)(m.Timestamp).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } if len(m.RawEvents) > 0 { i -= len(m.RawEvents) copy(dAtA[i:], m.RawEvents) i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RawEvents))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x42 } if len(m.Justification) > 0 { i -= len(m.Justification) copy(dAtA[i:], m.Justification) i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Justification))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x3a } if len(m.DigestItems) > 0 { for iNdEx := len(m.DigestItems) - 1; iNdEx >= 0; iNdEx-- { @@ -2490,7 +2500,7 @@ func (m *Block) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x32 } } if len(m.Events) > 0 { @@ -2502,7 +2512,7 @@ func (m *Block) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x2a } } if len(m.Extrinsics) > 0 { @@ -2514,18 +2524,8 @@ func (m *Block) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { i -= size i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x32 - } - } - if m.Timestamp != nil { - size, err := (*timestamppb1.Timestamp)(m.Timestamp).MarshalToSizedBufferVTStrict(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0x22 } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x2a } if m.Header != nil { size, err := m.Header.MarshalToSizedBufferVTStrict(dAtA[:i]) @@ -3707,10 +3707,6 @@ func (m *Block) SizeVT() (n int) { l = m.Header.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.Timestamp != nil { - l = (*timestamppb1.Timestamp)(m.Timestamp).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } if len(m.Extrinsics) > 0 { for _, e := range m.Extrinsics { l = e.SizeVT() @@ -3737,6 +3733,10 @@ func (m *Block) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.Timestamp != nil { + l = (*timestamppb1.Timestamp)(m.Timestamp).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -4297,9 +4297,9 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Extrinsics", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4326,16 +4326,14 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Timestamp == nil { - m.Timestamp = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.Timestamp).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Extrinsics = append(m.Extrinsics, &Extrinsic{}) + if err := m.Extrinsics[len(m.Extrinsics)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extrinsics", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4362,14 +4360,14 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Extrinsics = append(m.Extrinsics, &Extrinsic{}) - if err := m.Extrinsics[len(m.Extrinsics)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Events = append(m.Events, &Event{}) + if err := m.Events[len(m.Events)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DigestItems", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4396,16 +4394,16 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, &Event{}) - if err := m.Events[len(m.Events)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.DigestItems = append(m.DigestItems, &DigestItem{}) + if err := m.DigestItems[len(m.DigestItems)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 8: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DigestItems", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Justification", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -4415,29 +4413,29 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.DigestItems = append(m.DigestItems, &DigestItem{}) - if err := m.DigestItems[len(m.DigestItems)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Justification = append(m.Justification[:0], dAtA[iNdEx:postIndex]...) + if m.Justification == nil { + m.Justification = []byte{} } iNdEx = postIndex - case 9: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Justification", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RawEvents", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -4464,16 +4462,16 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Justification = append(m.Justification[:0], dAtA[iNdEx:postIndex]...) - if m.Justification == nil { - m.Justification = []byte{} + m.RawEvents = append(m.RawEvents[:0], dAtA[iNdEx:postIndex]...) + if m.RawEvents == nil { + m.RawEvents = []byte{} } iNdEx = postIndex - case 10: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RawEvents", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -4483,24 +4481,26 @@ func (m *Block) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.RawEvents = append(m.RawEvents[:0], dAtA[iNdEx:postIndex]...) - if m.RawEvents == nil { - m.RawEvents = []byte{} + if m.Timestamp == nil { + m.Timestamp = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.Timestamp).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: @@ -7252,9 +7252,9 @@ func (m *Block) UnmarshalVTUnsafe(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Extrinsics", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7281,16 +7281,14 @@ func (m *Block) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Timestamp == nil { - m.Timestamp = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.Timestamp).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.Extrinsics = append(m.Extrinsics, &Extrinsic{}) + if err := m.Extrinsics[len(m.Extrinsics)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extrinsics", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7317,14 +7315,14 @@ func (m *Block) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Extrinsics = append(m.Extrinsics, &Extrinsic{}) - if err := m.Extrinsics[len(m.Extrinsics)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.Events = append(m.Events, &Event{}) + if err := m.Events[len(m.Events)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DigestItems", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7351,16 +7349,16 @@ func (m *Block) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, &Event{}) - if err := m.Events[len(m.Events)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + m.DigestItems = append(m.DigestItems, &DigestItem{}) + if err := m.DigestItems[len(m.DigestItems)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 8: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DigestItems", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Justification", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7370,29 +7368,26 @@ func (m *Block) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.DigestItems = append(m.DigestItems, &DigestItem{}) - if err := m.DigestItems[len(m.DigestItems)-1].UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Justification = dAtA[iNdEx:postIndex] iNdEx = postIndex - case 9: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Justification", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RawEvents", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -7419,13 +7414,13 @@ func (m *Block) UnmarshalVTUnsafe(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Justification = dAtA[iNdEx:postIndex] + m.RawEvents = dAtA[iNdEx:postIndex] iNdEx = postIndex - case 10: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RawEvents", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protohelpers.ErrIntOverflow @@ -7435,22 +7430,27 @@ func (m *Block) UnmarshalVTUnsafe(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protohelpers.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.RawEvents = dAtA[iNdEx:postIndex] + if m.Timestamp == nil { + m.Timestamp = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.Timestamp).UnmarshalVTUnsafe(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/proto/sf/gear/type/v1/block.proto b/proto/sf/gear/type/v1/block.proto index 5edf21d..90a5382 100644 --- a/proto/sf/gear/type/v1/block.proto +++ b/proto/sf/gear/type/v1/block.proto @@ -8,12 +8,12 @@ message Block { uint64 number = 1; bytes hash = 2; Header header = 3; - google.protobuf.Timestamp timestamp = 5; - repeated Extrinsic extrinsics = 6; - repeated Event events = 7; - repeated DigestItem digest_items = 8; - bytes justification = 9; - bytes raw_events = 10; + repeated Extrinsic extrinsics = 4; + repeated Event events = 5; + repeated DigestItem digest_items = 6; + bytes justification = 7; + bytes raw_events = 8; + google.protobuf.Timestamp timestamp = 9; } message Header { @@ -128,10 +128,10 @@ message Event { } message Phase { - bool is_apply_extrinsic = 1; - uint32 as_apply_extrinsic = 2; - bool is_finalization = 3; - bool is_initialization = 4; + bool is_apply_extrinsic = 1; + uint32 as_apply_extrinsic = 2; + bool is_finalization = 3; + bool is_initialization = 4; } message MortalEra {