diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index d244193ef3..77476080b1 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -8,6 +8,8 @@ option go_package = "github.com/cosmos/interchain-security/x/ccv/provider/types" import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; import "interchain_security/ccv/provider/v1/keymap.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; // Msg defines the Msg service. service Msg { @@ -20,7 +22,11 @@ service Msg { message MsgDesignateConsensusKeyForConsumerChain { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string placeholder = 1; + string chain_id = 1; + string provider_validator_address = 2 + [ (gogoproto.moretags) = "yaml:\"address\"" ]; + google.protobuf.Any consumer_validator_pubkey = 3 + [ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; } message MsgDesignateConsensusKeyForConsumerChainResponse { diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index d458b130f3..ca52b560b4 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -6,10 +6,12 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/interchain-security/x/ccv/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -31,7 +33,9 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MsgDesignateConsensusKeyForConsumerChain struct { - Placeholder string `protobuf:"bytes,1,opt,name=placeholder,proto3" json:"placeholder,omitempty"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ProviderValidatorAddress string `protobuf:"bytes,2,opt,name=provider_validator_address,json=providerValidatorAddress,proto3" json:"provider_validator_address,omitempty" yaml:"address"` + ConsumerValidatorPubkey *types.Any `protobuf:"bytes,3,opt,name=consumer_validator_pubkey,json=consumerValidatorPubkey,proto3" json:"consumer_validator_pubkey,omitempty"` } func (m *MsgDesignateConsensusKeyForConsumerChain) Reset() { @@ -69,13 +73,6 @@ func (m *MsgDesignateConsensusKeyForConsumerChain) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDesignateConsensusKeyForConsumerChain proto.InternalMessageInfo -func (m *MsgDesignateConsensusKeyForConsumerChain) GetPlaceholder() string { - if m != nil { - return m.Placeholder - } - return "" -} - type MsgDesignateConsensusKeyForConsumerChainResponse struct { Placeholder string `protobuf:"bytes,1,opt,name=placeholder,proto3" json:"placeholder,omitempty"` } @@ -134,26 +131,36 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 304 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x91, 0xbf, 0x4a, 0x43, 0x31, - 0x14, 0x87, 0x1b, 0x04, 0xc1, 0xeb, 0x56, 0x1c, 0xa4, 0x48, 0x28, 0x15, 0xa1, 0x83, 0x26, 0xad, - 0x6e, 0x8e, 0x56, 0x5c, 0xb4, 0x4b, 0xa9, 0x8b, 0x8b, 0xa4, 0xe9, 0x21, 0x0d, 0xf6, 0xe6, 0x84, - 0x9c, 0xdc, 0x4b, 0xef, 0x5b, 0xf8, 0x58, 0x2e, 0x42, 0x17, 0xc1, 0x51, 0xda, 0x17, 0x91, 0xdb, - 0x5a, 0xff, 0x80, 0xe0, 0x1d, 0xdc, 0x4e, 0x4e, 0x4e, 0x3e, 0xbe, 0x9c, 0x5f, 0x72, 0x6c, 0x5d, - 0x84, 0xa0, 0x27, 0xca, 0xba, 0x7b, 0x02, 0x9d, 0x05, 0x1b,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, - 0x92, 0xfc, 0x32, 0x38, 0xf9, 0x4c, 0x76, 0xf6, 0x33, 0xdb, 0x58, 0x78, 0xa0, 0xd1, 0xf6, 0x2a, - 0xd8, 0xb3, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x9e, 0x37, 0x95, 0x93, 0x02, 0x00, 0x00, + // 463 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x4d, 0x6b, 0x13, 0x41, + 0x18, 0xde, 0x6d, 0x41, 0xeb, 0x16, 0x3c, 0x2c, 0x01, 0x37, 0x41, 0x36, 0x21, 0x22, 0xe4, 0x60, + 0x67, 0xda, 0x7a, 0xcb, 0xad, 0xa9, 0x08, 0x52, 0x02, 0x21, 0x54, 0x0f, 0x5e, 0xc2, 0xec, 0xec, + 0xb8, 0x19, 0xbb, 0x3b, 0xef, 0x30, 0x33, 0xbb, 0x74, 0xfe, 0x81, 0x17, 0xc1, 0x9f, 0xd0, 0x1f, + 0xe1, 0x8f, 0x10, 0x41, 0xe8, 0x45, 0xf0, 0x24, 0x92, 0x5c, 0x3c, 0xfb, 0x0b, 0x64, 0xbf, 0x6a, + 0x05, 0x0f, 0x7b, 0xf0, 0x36, 0xef, 0x3c, 0xef, 0xfb, 0xcc, 0xf3, 0xbc, 0xf3, 0x78, 0x4f, 0xb8, + 0x30, 0x4c, 0xd1, 0x35, 0xe1, 0x62, 0xa5, 0x19, 0xcd, 0x15, 0x37, 0x16, 0x53, 0x5a, 0x60, 0xa9, + 0xa0, 0xe0, 0x31, 0x53, 0xb8, 0x38, 0xc2, 0xe6, 0x12, 0x49, 0x05, 0x06, 0xfc, 0x47, 0xff, 0xe8, + 0x46, 0x94, 0x16, 0xa8, 0xed, 0x46, 0xc5, 0xd1, 0xe0, 0x61, 0x02, 0x90, 0xa4, 0x0c, 0x13, 0xc9, + 0x31, 0x11, 0x02, 0x0c, 0x31, 0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0xf3, 0xd8, 0xa2, 0xa2, 0x9b, + 0xee, 0xbd, 0xbb, 0x1a, 0x3a, 0x3f, 0xaf, 0x86, 0xce, 0xf8, 0xdc, 0x3b, 0xec, 0xba, 0x8e, 0x25, + 0xd3, 0xb2, 0x84, 0xfd, 0x91, 0xb7, 0x2f, 0x53, 0x42, 0xd9, 0x1a, 0xd2, 0x98, 0xa9, 0x66, 0x33, + 0xb7, 0xaf, 0x8e, 0xbf, 0xba, 0xde, 0xee, 0x5c, 0x27, 0xfe, 0x17, 0xd7, 0x7b, 0xdc, 0x6d, 0xd5, + 0x73, 0xd4, 0x21, 0x59, 0xa8, 0xab, 0xd4, 0xc1, 0xcb, 0xff, 0x4a, 0xd7, 0x3a, 0x9f, 0x9d, 0x7f, + 0xda, 0x84, 0xee, 0xf5, 0x26, 0x74, 0x7f, 0x6c, 0x42, 0xf7, 0xc3, 0x36, 0x74, 0xae, 0xb7, 0xa1, + 0xf3, 0x6d, 0x1b, 0x3a, 0xaf, 0xa7, 0x09, 0x37, 0xeb, 0x3c, 0x42, 0x14, 0xb2, 0x26, 0x8b, 0xf8, + 0x8f, 0x82, 0x83, 0x9b, 0x44, 0x5f, 0xfe, 0x9d, 0x69, 0x63, 0x25, 0xd3, 0xd1, 0x9d, 0xea, 0x3b, + 0x9f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x61, 0x56, 0xb1, 0xa6, 0x8b, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -256,10 +263,29 @@ func (m *MsgDesignateConsensusKeyForConsumerChain) MarshalToSizedBuffer(dAtA []b _ = i var l int _ = l - if len(m.Placeholder) > 0 { - i -= len(m.Placeholder) - copy(dAtA[i:], m.Placeholder) - i = encodeVarintTx(dAtA, i, uint64(len(m.Placeholder))) + if m.ConsumerValidatorPubkey != nil { + { + size, err := m.ConsumerValidatorPubkey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.ProviderValidatorAddress) > 0 { + i -= len(m.ProviderValidatorAddress) + copy(dAtA[i:], m.ProviderValidatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProviderValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) i-- dAtA[i] = 0xa } @@ -313,10 +339,18 @@ func (m *MsgDesignateConsensusKeyForConsumerChain) Size() (n int) { } var l int _ = l - l = len(m.Placeholder) + l = len(m.ChainId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.ProviderValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ConsumerValidatorPubkey != nil { + l = m.ConsumerValidatorPubkey.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -370,7 +404,7 @@ func (m *MsgDesignateConsensusKeyForConsumerChain) Unmarshal(dAtA []byte) error switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Placeholder", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -398,7 +432,75 @@ func (m *MsgDesignateConsensusKeyForConsumerChain) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - m.Placeholder = string(dAtA[iNdEx:postIndex]) + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderValidatorAddress", 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.ProviderValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsumerValidatorPubkey", 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.ConsumerValidatorPubkey == nil { + m.ConsumerValidatorPubkey = &types.Any{} + } + if err := m.ConsumerValidatorPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex