From 6682eecad96e65c65edb7c257325ec52a65b81fa Mon Sep 17 00:00:00 2001 From: lesterli Date: Fri, 6 Dec 2024 11:37:17 +0800 Subject: [PATCH] wip: msg handler --- proto/babylon/finality/v1/tx.proto | 16 + x/finality/keeper/msg_server.go | 6 + x/finality/types/tx.pb.go | 488 ++++++++++++++++++++++++++--- 3 files changed, 460 insertions(+), 50 deletions(-) diff --git a/proto/babylon/finality/v1/tx.proto b/proto/babylon/finality/v1/tx.proto index 90d6ee73b..3604d8a08 100644 --- a/proto/babylon/finality/v1/tx.proto +++ b/proto/babylon/finality/v1/tx.proto @@ -8,6 +8,7 @@ import "tendermint/crypto/proof.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "babylon/finality/v1/params.proto"; +import "babylon/finality/v1/finality.proto"; // Msg defines the Msg service. service Msg { @@ -23,6 +24,9 @@ service Msg { // UnjailFinalityProvider defines a method for unjailing a jailed // finality provider, thus it can receive voting power rpc UnjailFinalityProvider(MsgUnjailFinalityProvider) returns (MsgUnjailFinalityProviderResponse); + // EquivocationEvidence handles the evidence of equivocation message sent from + // the finality gadget cw contract + rpc EquivocationEvidence(MsgEquivocationEvidence) returns (MsgEquivocationEvidenceResponse); } // MsgCommitPubRandList defines a message for committing a list of public randomness for EOTS @@ -103,3 +107,15 @@ message MsgUnjailFinalityProvider { // MsgUnjailFinalityProviderResponse defines the Msg/UnjailFinalityProvider response type message MsgUnjailFinalityProviderResponse {} + +// MsgEquivocationEvidence is the message for handling evidence of equivocation +message MsgEquivocationEvidence { + // evidence is the evidence of equivocation + Evidence evidence = 1; +} + +// MsgEquivocationEvidenceResponse is the response for MsgEquivocationEvidence +message MsgEquivocationEvidenceResponse { + // success is true if the slashing was successfully applied + bool success = 1; +} diff --git a/x/finality/keeper/msg_server.go b/x/finality/keeper/msg_server.go index e7c25f2a8..062797e36 100644 --- a/x/finality/keeper/msg_server.go +++ b/x/finality/keeper/msg_server.go @@ -333,3 +333,9 @@ func (ms msgServer) validateActivationHeight(ctx sdk.Context, height uint64) (ui } return activationHeight, nil } + +// EquivocationEvidence handles the evidence of equivocation message sent from the finality gadget cw contract +func (ms msgServer) EquivocationEvidence(goCtx context.Context, req *types.MsgEquivocationEvidence) (*types.MsgEquivocationEvidenceResponse, error) { + // TODO: implement this + return &types.MsgEquivocationEvidenceResponse{Success: true}, nil +} diff --git a/x/finality/types/tx.pb.go b/x/finality/types/tx.pb.go index 835433de4..792adef8c 100644 --- a/x/finality/types/tx.pb.go +++ b/x/finality/types/tx.pb.go @@ -442,6 +442,98 @@ func (m *MsgUnjailFinalityProviderResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnjailFinalityProviderResponse proto.InternalMessageInfo +// MsgEquivocationEvidence is the message for handling evidence of equivocation +type MsgEquivocationEvidence struct { + // evidence is the evidence of equivocation + Evidence *Evidence `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"` +} + +func (m *MsgEquivocationEvidence) Reset() { *m = MsgEquivocationEvidence{} } +func (m *MsgEquivocationEvidence) String() string { return proto.CompactTextString(m) } +func (*MsgEquivocationEvidence) ProtoMessage() {} +func (*MsgEquivocationEvidence) Descriptor() ([]byte, []int) { + return fileDescriptor_2dd6da066b6baf1d, []int{8} +} +func (m *MsgEquivocationEvidence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEquivocationEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEquivocationEvidence.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 *MsgEquivocationEvidence) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEquivocationEvidence.Merge(m, src) +} +func (m *MsgEquivocationEvidence) XXX_Size() int { + return m.Size() +} +func (m *MsgEquivocationEvidence) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEquivocationEvidence.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEquivocationEvidence proto.InternalMessageInfo + +func (m *MsgEquivocationEvidence) GetEvidence() *Evidence { + if m != nil { + return m.Evidence + } + return nil +} + +// MsgEquivocationEvidenceResponse is the response for MsgEquivocationEvidence +type MsgEquivocationEvidenceResponse struct { + // success is true if the slashing was successfully applied + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (m *MsgEquivocationEvidenceResponse) Reset() { *m = MsgEquivocationEvidenceResponse{} } +func (m *MsgEquivocationEvidenceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEquivocationEvidenceResponse) ProtoMessage() {} +func (*MsgEquivocationEvidenceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2dd6da066b6baf1d, []int{9} +} +func (m *MsgEquivocationEvidenceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEquivocationEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEquivocationEvidenceResponse.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 *MsgEquivocationEvidenceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEquivocationEvidenceResponse.Merge(m, src) +} +func (m *MsgEquivocationEvidenceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEquivocationEvidenceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEquivocationEvidenceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEquivocationEvidenceResponse proto.InternalMessageInfo + +func (m *MsgEquivocationEvidenceResponse) GetSuccess() bool { + if m != nil { + return m.Success + } + return false +} + func init() { proto.RegisterType((*MsgCommitPubRandList)(nil), "babylon.finality.v1.MsgCommitPubRandList") proto.RegisterType((*MsgCommitPubRandListResponse)(nil), "babylon.finality.v1.MsgCommitPubRandListResponse") @@ -451,61 +543,68 @@ func init() { proto.RegisterType((*MsgUpdateParamsResponse)(nil), "babylon.finality.v1.MsgUpdateParamsResponse") proto.RegisterType((*MsgUnjailFinalityProvider)(nil), "babylon.finality.v1.MsgUnjailFinalityProvider") proto.RegisterType((*MsgUnjailFinalityProviderResponse)(nil), "babylon.finality.v1.MsgUnjailFinalityProviderResponse") + proto.RegisterType((*MsgEquivocationEvidence)(nil), "babylon.finality.v1.MsgEquivocationEvidence") + proto.RegisterType((*MsgEquivocationEvidenceResponse)(nil), "babylon.finality.v1.MsgEquivocationEvidenceResponse") } func init() { proto.RegisterFile("babylon/finality/v1/tx.proto", fileDescriptor_2dd6da066b6baf1d) } var fileDescriptor_2dd6da066b6baf1d = []byte{ - // 774 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x4f, 0x1b, 0x47, - 0x18, 0xf5, 0x62, 0x30, 0x65, 0x6c, 0x81, 0xd8, 0x22, 0x58, 0x0c, 0x5d, 0x1b, 0x17, 0x55, 0x14, - 0x95, 0xdd, 0x62, 0x10, 0x6d, 0xdd, 0x13, 0xae, 0x5a, 0x51, 0x15, 0xab, 0xd6, 0x1a, 0x2e, 0x91, - 0xa2, 0xd5, 0xfe, 0xf2, 0xec, 0x04, 0xef, 0xce, 0x64, 0x66, 0x16, 0xe1, 0x1b, 0xca, 0x29, 0xc7, - 0x1c, 0x72, 0xca, 0x29, 0x7f, 0x02, 0x87, 0x5c, 0x73, 0x8c, 0xc4, 0x11, 0xe5, 0x14, 0x71, 0xb0, - 0x22, 0x38, 0xf0, 0x6f, 0x44, 0xde, 0x5d, 0xdb, 0x18, 0x6c, 0xc5, 0xe4, 0xc0, 0xcd, 0x33, 0xdf, - 0x9b, 0xf9, 0xde, 0xbc, 0xf7, 0x3e, 0x2f, 0x58, 0x36, 0x0d, 0xb3, 0xd9, 0xc0, 0xbe, 0x5a, 0x47,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0x76, 0x73, 0x64, 0x68, 0xa7, 0xb5, 0xe8, 0x82, 0xe9, 0x3b, 0x73, 0xfc, 0xd3, - 0xb0, 0x4b, 0xfa, 0x71, 0x59, 0x65, 0x34, 0x5c, 0xb7, 0x93, 0x09, 0x32, 0x7d, 0xa1, 0x5a, 0x1d, - 0x76, 0xfe, 0x36, 0x2a, 0xfb, 0xcb, 0x28, 0xa8, 0x6e, 0x8f, 0x53, 0x01, 0xcc, 0x0f, 0xc9, 0xc1, - 0x50, 0xba, 0x83, 0xf1, 0xd9, 0x9d, 0x87, 0xe1, 0x3b, 0x14, 0xb2, 0x13, 0xa7, 0x37, 0x67, 0xeb, - 0x42, 0x79, 0xff, 0xfc, 0x4a, 0x16, 0x2e, 0xae, 0x64, 0xe1, 0xf3, 0x95, 0x2c, 0xbc, 0xba, 0x96, - 0x13, 0x17, 0xd7, 0x72, 0xe2, 0xd3, 0xb5, 0x9c, 0x78, 0x52, 0xfc, 0x7a, 0xc2, 0x4e, 0x7a, 0xdf, - 0xb8, 0x30, 0x6c, 0x66, 0x2a, 0xfc, 0xc0, 0x6d, 0x7d, 0x09, 0x00, 0x00, 0xff, 0xff, 0x64, 0x3e, - 0x90, 0x65, 0xa0, 0x07, 0x00, 0x00, + // 856 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xbf, 0x6f, 0xdb, 0x46, + 0x14, 0x16, 0xe3, 0xdf, 0x27, 0xc1, 0x41, 0x58, 0x23, 0xa1, 0x95, 0x44, 0x52, 0xd4, 0xa0, 0x70, + 0x83, 0x86, 0xac, 0x15, 0xc3, 0x6d, 0x9c, 0xc9, 0x2a, 0x5c, 0xa4, 0x68, 0x84, 0x0a, 0x94, 0xbd, + 0x14, 0x28, 0x84, 0x23, 0x79, 0x3a, 0x5e, 0x2d, 0xde, 0x5d, 0xee, 0x8e, 0x46, 0xd4, 0x29, 0xe8, + 0xd4, 0xb1, 0x43, 0xa7, 0x4e, 0xfd, 0x13, 0x32, 0x74, 0xed, 0x58, 0x20, 0x43, 0x87, 0xa0, 0x53, + 0xe1, 0xc1, 0x28, 0xec, 0x21, 0xff, 0x46, 0xa1, 0xe3, 0x0f, 0xd9, 0x0e, 0x85, 0xda, 0x19, 0xbc, + 0xf1, 0xee, 0x7d, 0xef, 0xbd, 0xef, 0xbd, 0xef, 0xbd, 0x23, 0xb8, 0xe3, 0x41, 0x6f, 0x34, 0x64, + 0xd4, 0x19, 0x10, 0x0a, 0x87, 0x44, 0x8d, 0x9c, 0x83, 0x75, 0x47, 0xbd, 0xb0, 0xb9, 0x60, 0x8a, + 0x99, 0x1f, 0xa4, 0x56, 0x3b, 0xb3, 0xda, 0x07, 0xeb, 0xd5, 0x15, 0xcc, 0x30, 0xd3, 0x76, 0x67, + 0xfc, 0x95, 0x40, 0xab, 0x77, 0x15, 0xa2, 0x01, 0x12, 0x11, 0xa1, 0xca, 0xf1, 0xc5, 0x88, 0x2b, + 0xe6, 0x70, 0xc1, 0xd8, 0x20, 0x35, 0xaf, 0xfa, 0x4c, 0x46, 0x4c, 0xf6, 0x13, 0xbf, 0xe4, 0x90, + 0x9a, 0x6e, 0x25, 0x27, 0x27, 0x92, 0x78, 0x9c, 0x3c, 0x92, 0x38, 0x35, 0x34, 0x8a, 0xb8, 0x71, + 0x28, 0x60, 0x94, 0xb9, 0x36, 0x8b, 0x10, 0x39, 0x57, 0x8d, 0x69, 0xfe, 0x79, 0x0d, 0xac, 0x74, + 0x24, 0xfe, 0x82, 0x45, 0x11, 0x51, 0xdd, 0xd8, 0x73, 0x21, 0x0d, 0x9e, 0x11, 0xa9, 0xcc, 0x9b, + 0x60, 0x5e, 0x12, 0x4c, 0x91, 0xb0, 0x8c, 0x86, 0xb1, 0xb6, 0xe4, 0xa6, 0x27, 0x73, 0x17, 0x2c, + 0x0d, 0x78, 0xdf, 0x53, 0x7e, 0x9f, 0xef, 0x5b, 0xd7, 0x1a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, 0xee, 0xe5, 0xdb, 0x57, 0x0f, 0x8c, + 0xf6, 0xb3, 0xd7, 0xc7, 0x35, 0xe3, 0xcd, 0x71, 0xcd, 0xf8, 0xf7, 0xb8, 0x66, 0xfc, 0x7c, 0x52, + 0x2b, 0xbd, 0x39, 0xa9, 0x95, 0xfe, 0x39, 0xa9, 0x95, 0xbe, 0x6d, 0xfd, 0xff, 0xc2, 0xbd, 0x98, + 0xfc, 0xf4, 0xf5, 0xee, 0x79, 0xf3, 0xfa, 0x7f, 0xff, 0xe8, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x6d, 0x4b, 0xa5, 0xf1, 0xd3, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -530,6 +629,9 @@ type MsgClient interface { // UnjailFinalityProvider defines a method for unjailing a jailed // finality provider, thus it can receive voting power UnjailFinalityProvider(ctx context.Context, in *MsgUnjailFinalityProvider, opts ...grpc.CallOption) (*MsgUnjailFinalityProviderResponse, error) + // EquivocationEvidence handles the evidence of equivocation message sent from + // the finality gadget cw contract + EquivocationEvidence(ctx context.Context, in *MsgEquivocationEvidence, opts ...grpc.CallOption) (*MsgEquivocationEvidenceResponse, error) } type msgClient struct { @@ -576,6 +678,15 @@ func (c *msgClient) UnjailFinalityProvider(ctx context.Context, in *MsgUnjailFin return out, nil } +func (c *msgClient) EquivocationEvidence(ctx context.Context, in *MsgEquivocationEvidence, opts ...grpc.CallOption) (*MsgEquivocationEvidenceResponse, error) { + out := new(MsgEquivocationEvidenceResponse) + err := c.cc.Invoke(ctx, "/babylon.finality.v1.Msg/EquivocationEvidence", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // CommitPubRandList commits a list of public randomness for EOTS @@ -588,6 +699,9 @@ type MsgServer interface { // UnjailFinalityProvider defines a method for unjailing a jailed // finality provider, thus it can receive voting power UnjailFinalityProvider(context.Context, *MsgUnjailFinalityProvider) (*MsgUnjailFinalityProviderResponse, error) + // EquivocationEvidence handles the evidence of equivocation message sent from + // the finality gadget cw contract + EquivocationEvidence(context.Context, *MsgEquivocationEvidence) (*MsgEquivocationEvidenceResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -606,6 +720,9 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP func (*UnimplementedMsgServer) UnjailFinalityProvider(ctx context.Context, req *MsgUnjailFinalityProvider) (*MsgUnjailFinalityProviderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnjailFinalityProvider not implemented") } +func (*UnimplementedMsgServer) EquivocationEvidence(ctx context.Context, req *MsgEquivocationEvidence) (*MsgEquivocationEvidenceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EquivocationEvidence not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -683,6 +800,24 @@ func _Msg_UnjailFinalityProvider_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _Msg_EquivocationEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEquivocationEvidence) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EquivocationEvidence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/babylon.finality.v1.Msg/EquivocationEvidence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EquivocationEvidence(ctx, req.(*MsgEquivocationEvidence)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "babylon.finality.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -703,6 +838,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UnjailFinalityProvider", Handler: _Msg_UnjailFinalityProvider_Handler, }, + { + MethodName: "EquivocationEvidence", + Handler: _Msg_EquivocationEvidence_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "babylon/finality/v1/tx.proto", @@ -1043,6 +1182,74 @@ func (m *MsgUnjailFinalityProviderResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } +func (m *MsgEquivocationEvidence) 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 *MsgEquivocationEvidence) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEquivocationEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Evidence != nil { + { + size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgEquivocationEvidenceResponse) 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 *MsgEquivocationEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEquivocationEvidenceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Success { + i-- + if m.Success { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1189,6 +1396,31 @@ func (m *MsgUnjailFinalityProviderResponse) Size() (n int) { return n } +func (m *MsgEquivocationEvidence) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Evidence != nil { + l = m.Evidence.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgEquivocationEvidenceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Success { + n += 2 + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2127,6 +2359,162 @@ func (m *MsgUnjailFinalityProviderResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgEquivocationEvidence) 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: MsgEquivocationEvidence: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEquivocationEvidence: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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.Evidence == nil { + m.Evidence = &Evidence{} + } + if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 *MsgEquivocationEvidenceResponse) 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: MsgEquivocationEvidenceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEquivocationEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Success", 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.Success = 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0