diff --git a/app/consumer-democracy/app.go b/app/consumer-democracy/app.go index 093f7e354a..7d5646f1dc 100644 --- a/app/consumer-democracy/app.go +++ b/app/consumer-democracy/app.go @@ -711,7 +711,7 @@ func New( return fromVM, fmt.Errorf("failed to unmarshal genesis state: %w", err) } - consumerGenesis := consumertypes.PrivateConsumerGenesisState{} + consumerGenesis := consumertypes.GenesisState{} appCodec.MustUnmarshalJSON(appState[consumertypes.ModuleName], &consumerGenesis) consumerGenesis.PreCCV = true diff --git a/proto/interchain_security/ccv/consumer/v1/genesis.proto b/proto/interchain_security/ccv/consumer/v1/genesis.proto index fd1ab16727..c90d4d4e00 100644 --- a/proto/interchain_security/ccv/consumer/v1/genesis.proto +++ b/proto/interchain_security/ccv/consumer/v1/genesis.proto @@ -9,13 +9,15 @@ import "gogoproto/gogo.proto"; import "interchain_security/ccv/v1/wire.proto"; import "google/protobuf/timestamp.proto"; + + // GenesisState defines the CCV consumer genesis state // -// Note this type is only used on consumer side and references shared type with -// consumer -// TODO: rename to GenesisState -message PrivateConsumerGenesisState { +// Note: this type is only used on consumer side and references shared types with +// provider +message GenesisState { reserved 5, 6, 8; + // ConsumerParams is a shared type with provider module interchain_security.ccv.v1.ConsumerParams params = 1 [ (gogoproto.nullable) = false ]; // Client ID of the provider. Empty for a new chain, filled in on restart. @@ -47,27 +49,25 @@ message PrivateConsumerGenesisState { } // HeightValsetUpdateID represents a mapping internal to the consumer CCV module -// AND used in shared consumer genesis state, which links a block height to each -// recv valset update id. +// which links a block height to each recv valset update id. message HeightToValsetUpdateID { uint64 height = 1; uint64 valset_update_id = 2; } // OutstandingDowntime defines the type used internally to the consumer CCV -// module, AND used in shared consumer genesis state, in order to not send -// multiple slashing requests for the same downtime infraction. +// module and is used in order to not send multiple slashing requests for +// the same downtime infraction. message OutstandingDowntime { string validator_consensus_address = 1; } // LastTransmissionBlockHeight is the last time validator holding // pools were transmitted to the provider chain. This type is used internally -// to the consumer CCV module AND used in shared consumer genesis state. +// to the consumer CCV modul. message LastTransmissionBlockHeight { int64 height = 1; } // MaturingVSCPacket represents a vsc packet that is maturing internal to the // consumer CCV module, where the consumer has not yet relayed a VSCMatured -// packet back to the provider. This type is used internally to the consumer -// CCV module AND used in shared consumer genesis state. +// packet back to the provider. message MaturingVSCPacket { uint64 vscId = 1; google.protobuf.Timestamp maturity_time = 2 @@ -77,9 +77,7 @@ message MaturingVSCPacket { // ConsumerPacketDataList is a list of consumer packet data packets. // // Note this type is is used internally to the consumer CCV module -// for exporting / importing state in InitGenesis and ExportGenesis, -// AND included in the consumer genesis type (reffed by provider and consumer -// modules), hence this is a shared type. +// for exporting / importing state in InitGenesis and ExportGenesis. message ConsumerPacketDataList { repeated interchain_security.ccv.v1.ConsumerPacketData list = 1 [ (gogoproto.nullable) = false ]; diff --git a/tests/difference/core/driver/setup.go b/tests/difference/core/driver/setup.go index 07feb2b3c2..52f02ada29 100644 --- a/tests/difference/core/driver/setup.go +++ b/tests/difference/core/driver/setup.go @@ -207,7 +207,7 @@ func (b *Builder) getAppBytesAndSenders( bondDenom := sdk.DefaultBondDenom genesisStaking := stakingtypes.GenesisState{} - genesisConsumer := consumertypes.PrivateConsumerGenesisState{} + genesisConsumer := consumertypes.GenesisState{} if genesis[stakingtypes.ModuleName] != nil { // If staking module genesis already exists @@ -522,7 +522,7 @@ func (b *Builder) createConsumersLocalClientGenesis() *ibctmtypes.ClientState { ) } -func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *consumertypes.PrivateConsumerGenesisState { +func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *consumertypes.GenesisState { providerConsState := b.provider().LastHeader.ConsensusState() valUpdates := tmtypes.TM2PB.ValidatorUpdates(b.provider().Vals) @@ -540,7 +540,7 @@ func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *consume []string{}, []string{}, ) - return consumertypes.NewPrivateInitialConsumerGenesisState(client, providerConsState, valUpdates, params) + return consumertypes.NewInitialGenesisState(client, providerConsState, valUpdates, params) } // The state of the data returned is equivalent to the state of two chains diff --git a/tests/integration/setup.go b/tests/integration/setup.go index 6253c6865a..eee8fb1a22 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -148,12 +148,12 @@ func (suite *CCVTestSuite) SetupTest() { chainID, ) suite.Require().True(found, "consumer genesis not found") - privateConsumerGenesisState := consumertypes.PrivateConsumerGenesisState{ + genesisState := consumertypes.GenesisState{ Params: consumerGenesisState.Params, Provider: consumerGenesisState.Provider, NewChain: consumerGenesisState.NewChain, } - initConsumerChain(suite, chainID, &privateConsumerGenesisState) + initConsumerChain(suite, chainID, &genesisState) } // try updating all clients @@ -187,7 +187,7 @@ func (s *CCVTestSuite) getSentPacket(chain *ibctesting.TestChain, sequence uint6 func initConsumerChain( s *CCVTestSuite, chainID string, - genesisState *consumertypes.PrivateConsumerGenesisState, + genesisState *consumertypes.GenesisState, ) { providerKeeper := s.providerApp.GetProviderKeeper() bundle := s.consumerBundles[chainID] diff --git a/x/ccv/consumer/keeper/genesis.go b/x/ccv/consumer/keeper/genesis.go index 0654d15b45..78f777ea6f 100644 --- a/x/ccv/consumer/keeper/genesis.go +++ b/x/ccv/consumer/keeper/genesis.go @@ -16,7 +16,7 @@ import ( // 1. A client to the provider was never created, i.e. a new consumer chain is started for the first time. // 2. A consumer chain restarts after a client to the provider was created, but the CCV channel handshake is still in progress // 3. A consumer chain restarts after the CCV channel handshake was completed. -func (k Keeper) InitGenesis(ctx sdk.Context, state *types.PrivateConsumerGenesisState) []abci.ValidatorUpdate { +func (k Keeper) InitGenesis(ctx sdk.Context, state *types.GenesisState) []abci.ValidatorUpdate { // PreCCV is true during the process of a standalone to consumer changeover. // At the PreCCV point in the process, the standalone chain has just been upgraded to include // the consumer ccv module, but the standalone staking keeper is still managing the validator set. @@ -115,10 +115,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *types.PrivateConsumerGenesis } // ExportGenesis returns the CCV consumer module's exported genesis -func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *types.PrivateConsumerGenesisState) { +func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *types.GenesisState) { params := k.GetConsumerParams(ctx) if !params.Enabled { - return types.DefaultPrivateConsumerGenesisState() + return types.DefaultGenesisState() } // export the current validator set @@ -137,7 +137,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *types.PrivateConsumerGe panic("provider client does not exist although provider channel does exist") } - genesis = types.NewRestartConsumerGenesisState( + genesis = types.NewRestartGenesisState( clientID, channelID, k.GetAllPacketMaturityTimes(ctx), @@ -153,11 +153,11 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *types.PrivateConsumerGe // if provider clientID and channelID don't exist on the consumer chain, // then CCV protocol is disabled for this chain return a default genesis state if !ok { - return types.DefaultPrivateConsumerGenesisState() + return types.DefaultGenesisState() } // export client states and pending slashing requests into a new chain genesis - genesis = types.NewRestartConsumerGenesisState( + genesis = types.NewRestartGenesisState( clientID, "", nil, diff --git a/x/ccv/consumer/keeper/genesis_test.go b/x/ccv/consumer/keeper/genesis_test.go index e2808416d4..93e856d6ef 100644 --- a/x/ccv/consumer/keeper/genesis_test.go +++ b/x/ccv/consumer/keeper/genesis_test.go @@ -100,8 +100,8 @@ func TestInitGenesis(t *testing.T) { testCases := []struct { name string malleate func(sdk.Context, testkeeper.MockedKeepers) - genesis *consumertypes.PrivateConsumerGenesisState - assertStates func(sdk.Context, consumerkeeper.Keeper, *consumertypes.PrivateConsumerGenesisState) + genesis *consumertypes.GenesisState + assertStates func(sdk.Context, consumerkeeper.Keeper, *consumertypes.GenesisState) }{ { "start a new chain", @@ -112,13 +112,13 @@ func TestInitGenesis(t *testing.T) { testkeeper.ExpectGetCapabilityMock(ctx, mocks, 1), ) }, - consumertypes.NewPrivateInitialConsumerGenesisState( + consumertypes.NewInitialGenesisState( provClientState, provConsState, valset, params, ), - func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *consumertypes.PrivateConsumerGenesisState) { + func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *consumertypes.GenesisState) { assertConsumerPortIsBound(t, ctx, &ck) assertProviderClientID(t, ctx, &ck, provClientID) @@ -134,7 +134,7 @@ func TestInitGenesis(t *testing.T) { testkeeper.ExpectGetCapabilityMock(ctx, mocks, 2), ) }, - consumertypes.NewRestartConsumerGenesisState( + consumertypes.NewRestartGenesisState( provClientID, "", matPackets, @@ -145,7 +145,7 @@ func TestInitGenesis(t *testing.T) { consumertypes.LastTransmissionBlockHeight{}, params, ), - func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *consumertypes.PrivateConsumerGenesisState) { + func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *consumertypes.GenesisState) { assertConsumerPortIsBound(t, ctx, &ck) obtainedPendingPackets := ck.GetPendingPackets(ctx) @@ -170,7 +170,7 @@ func TestInitGenesis(t *testing.T) { ) }, // create a genesis for a restarted chain - consumertypes.NewRestartConsumerGenesisState( + consumertypes.NewRestartGenesisState( provClientID, provChannelID, matPackets, @@ -183,7 +183,7 @@ func TestInitGenesis(t *testing.T) { consumertypes.LastTransmissionBlockHeight{Height: int64(100)}, params, ), - func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *consumertypes.PrivateConsumerGenesisState) { + func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *consumertypes.GenesisState) { assertConsumerPortIsBound(t, ctx, &ck) gotChannelID, ok := ck.GetProviderChannel(ctx) @@ -289,7 +289,7 @@ func TestExportGenesis(t *testing.T) { testCases := []struct { name string malleate func(sdk.Context, consumerkeeper.Keeper, testkeeper.MockedKeepers) - expGenesis *consumertypes.PrivateConsumerGenesisState + expGenesis *consumertypes.GenesisState }{ { "export a chain without an established CCV channel", @@ -307,7 +307,7 @@ func TestExportGenesis(t *testing.T) { ck.SetHeightValsetUpdateID(ctx, defaultHeightValsetUpdateIDs[0].Height, defaultHeightValsetUpdateIDs[0].ValsetUpdateId) }, - consumertypes.NewRestartConsumerGenesisState( + consumertypes.NewRestartGenesisState( provClientID, "", nil, @@ -343,7 +343,7 @@ func TestExportGenesis(t *testing.T) { ck.SetOutstandingDowntime(ctx, sdk.ConsAddress(validator.Address.Bytes())) ck.SetLastTransmissionBlockHeight(ctx, ltbh) }, - consumertypes.NewRestartConsumerGenesisState( + consumertypes.NewRestartGenesisState( provClientID, provChannelID, matPackets, diff --git a/x/ccv/consumer/keeper/keeper.go b/x/ccv/consumer/keeper/keeper.go index 1c8d536325..0d0ac988ad 100644 --- a/x/ccv/consumer/keeper/keeper.go +++ b/x/ccv/consumer/keeper/keeper.go @@ -309,7 +309,7 @@ func (k Keeper) DeletePreCCV(ctx sdk.Context) { func (k Keeper) SetInitialValSet(ctx sdk.Context, initialValSet []tmtypes.ValidatorUpdate) { store := ctx.KVStore(k.storeKey) - initialValSetState := types.PrivateConsumerGenesisState{ + initialValSetState := types.GenesisState{ Provider: ccv.ProviderInfo{InitialValSet: initialValSet}, } bz := k.cdc.MustMarshal(&initialValSetState) @@ -318,7 +318,7 @@ func (k Keeper) SetInitialValSet(ctx sdk.Context, initialValSet []tmtypes.Valida func (k Keeper) GetInitialValSet(ctx sdk.Context) []tmtypes.ValidatorUpdate { store := ctx.KVStore(k.storeKey) - initialValSet := types.PrivateConsumerGenesisState{} + initialValSet := types.GenesisState{} bz := store.Get(types.InitialValSetKey()) if bz != nil { k.cdc.MustUnmarshal(bz, &initialValSet) diff --git a/x/ccv/consumer/module.go b/x/ccv/consumer/module.go index d0f15877b3..f063075211 100644 --- a/x/ccv/consumer/module.go +++ b/x/ccv/consumer/module.go @@ -57,7 +57,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { // ValidateGenesis performs genesis state validation for the ibc consumer module. func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var data consumertypes.PrivateConsumerGenesisState + var data consumertypes.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", consumertypes.ModuleName, err) } @@ -117,7 +117,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the consumer module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState consumertypes.PrivateConsumerGenesisState + var genesisState consumertypes.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) return am.keeper.InitGenesis(ctx, &genesisState) } diff --git a/x/ccv/consumer/types/consumer.pb.go b/x/ccv/consumer/types/consumer.pb.go index 067b04f92d..93a3c32a83 100644 --- a/x/ccv/consumer/types/consumer.pb.go +++ b/x/ccv/consumer/types/consumer.pb.go @@ -29,10 +29,10 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// CrossChainValidator defines the type used to store validator information internal -// to the consumer CCV module. Note one cross chain validator entry is persisted for -// each consumer validator, where incoming VSC packets update this data, which is eventually -// forwarded to comet for consumer chain consensus. +// CrossChainValidator defines the type used to store validator information +// internal to the consumer CCV module. Note one cross chain validator entry is +// persisted for each consumer validator, where incoming VSC packets update this +// data, which is eventually forwarded to comet for consumer chain consensus. // // Note this type is only used internally to the consumer CCV module. type CrossChainValidator struct { diff --git a/x/ccv/consumer/types/genesis.go b/x/ccv/consumer/types/genesis.go index 2f32865e31..bcc26786fb 100644 --- a/x/ccv/consumer/types/genesis.go +++ b/x/ccv/consumer/types/genesis.go @@ -7,8 +7,8 @@ import ( ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) -// NewRestartConsumerGenesisState returns a ConsumerGenesisState that has already been established. -func NewRestartConsumerGenesisState( +// NewRestartGenesisState returns a consumer GenesisState that has already been established. +func NewRestartGenesisState( clientID, channelID string, maturingPackets []MaturingVSCPacket, initValSet []abci.ValidatorUpdate, @@ -17,8 +17,8 @@ func NewRestartConsumerGenesisState( outstandingDowntimes []OutstandingDowntime, lastTransBlockHeight LastTransmissionBlockHeight, params ccv.ConsumerParams, -) *PrivateConsumerGenesisState { - return &PrivateConsumerGenesisState{ +) *GenesisState { + return &GenesisState{ NewChain: false, Params: params, Provider: ccv.ProviderInfo{ @@ -34,19 +34,19 @@ func NewRestartConsumerGenesisState( } } -// DefaultConsumerGenesisState returns a default disabled consumer chain genesis state. This allows the module to be hooked up to app without getting use +// DefaultGenesisState returns a default disabled consumer chain genesis state. This allows the module to be hooked up to app without getting use // unless explicitly specified in genesis. -func DefaultPrivateConsumerGenesisState() *PrivateConsumerGenesisState { - return &PrivateConsumerGenesisState{ +func DefaultGenesisState() *GenesisState { + return &GenesisState{ Params: ccv.DefaultParams(), } } -// NewPrivateInitialConsumerGenesisState returns a PrivateConsumerGenesisState for a completely new consumer chain. -func NewPrivateInitialConsumerGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.ConsensusState, +// NewInitialGenesisState returns a GenesisState for a completely new consumer chain. +func NewInitialGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.ConsensusState, initValSet []abci.ValidatorUpdate, params ccv.ConsumerParams, -) *PrivateConsumerGenesisState { - return &PrivateConsumerGenesisState{ +) *GenesisState { + return &GenesisState{ NewChain: true, Params: params, Provider: ccv.ProviderInfo{ @@ -74,7 +74,7 @@ func NewPrivateInitialConsumerGenesisState(cs *ibctmtypes.ClientState, consState // - MaturingVSCPackets, OutstandingDowntime, PendingConsumerPacket, LastTransmissionBlockHeight // optional // -func (gs PrivateConsumerGenesisState) Validate() error { +func (gs GenesisState) Validate() error { if !gs.Params.Enabled { return nil } diff --git a/x/ccv/consumer/types/genesis.pb.go b/x/ccv/consumer/types/genesis.pb.go index a8ca2a6f63..e11f29bdca 100644 --- a/x/ccv/consumer/types/genesis.pb.go +++ b/x/ccv/consumer/types/genesis.pb.go @@ -30,9 +30,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the CCV consumer genesis state // -// Note this type is only used on consumer side and references shared type with consumer -// TODO: rename to GenesisState -type PrivateConsumerGenesisState struct { +// Note: this type is only used on consumer side and references shared types with +// provider +type GenesisState struct { + // ConsumerParams is a shared type with provider module Params types.ConsumerParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // Client ID of the provider. Empty for a new chain, filled in on restart. ProviderClientId string `protobuf:"bytes,2,opt,name=provider_client_id,json=providerClientId,proto3" json:"provider_client_id,omitempty"` @@ -55,18 +56,18 @@ type PrivateConsumerGenesisState struct { Provider types.ProviderInfo `protobuf:"bytes,14,opt,name=provider,proto3" json:"provider"` } -func (m *PrivateConsumerGenesisState) Reset() { *m = PrivateConsumerGenesisState{} } -func (m *PrivateConsumerGenesisState) String() string { return proto.CompactTextString(m) } -func (*PrivateConsumerGenesisState) ProtoMessage() {} -func (*PrivateConsumerGenesisState) Descriptor() ([]byte, []int) { +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_2db73a6057a27482, []int{0} } -func (m *PrivateConsumerGenesisState) XXX_Unmarshal(b []byte) error { +func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PrivateConsumerGenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PrivateConsumerGenesisState.Marshal(b, m, deterministic) + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -76,89 +77,89 @@ func (m *PrivateConsumerGenesisState) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *PrivateConsumerGenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivateConsumerGenesisState.Merge(m, src) +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) } -func (m *PrivateConsumerGenesisState) XXX_Size() int { +func (m *GenesisState) XXX_Size() int { return m.Size() } -func (m *PrivateConsumerGenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_PrivateConsumerGenesisState.DiscardUnknown(m) +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) } -var xxx_messageInfo_PrivateConsumerGenesisState proto.InternalMessageInfo +var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *PrivateConsumerGenesisState) GetParams() types.ConsumerParams { +func (m *GenesisState) GetParams() types.ConsumerParams { if m != nil { return m.Params } return types.ConsumerParams{} } -func (m *PrivateConsumerGenesisState) GetProviderClientId() string { +func (m *GenesisState) GetProviderClientId() string { if m != nil { return m.ProviderClientId } return "" } -func (m *PrivateConsumerGenesisState) GetProviderChannelId() string { +func (m *GenesisState) GetProviderChannelId() string { if m != nil { return m.ProviderChannelId } return "" } -func (m *PrivateConsumerGenesisState) GetNewChain() bool { +func (m *GenesisState) GetNewChain() bool { if m != nil { return m.NewChain } return false } -func (m *PrivateConsumerGenesisState) GetMaturingPackets() []MaturingVSCPacket { +func (m *GenesisState) GetMaturingPackets() []MaturingVSCPacket { if m != nil { return m.MaturingPackets } return nil } -func (m *PrivateConsumerGenesisState) GetHeightToValsetUpdateId() []HeightToValsetUpdateID { +func (m *GenesisState) GetHeightToValsetUpdateId() []HeightToValsetUpdateID { if m != nil { return m.HeightToValsetUpdateId } return nil } -func (m *PrivateConsumerGenesisState) GetOutstandingDowntimeSlashing() []OutstandingDowntime { +func (m *GenesisState) GetOutstandingDowntimeSlashing() []OutstandingDowntime { if m != nil { return m.OutstandingDowntimeSlashing } return nil } -func (m *PrivateConsumerGenesisState) GetPendingConsumerPackets() ConsumerPacketDataList { +func (m *GenesisState) GetPendingConsumerPackets() ConsumerPacketDataList { if m != nil { return m.PendingConsumerPackets } return ConsumerPacketDataList{} } -func (m *PrivateConsumerGenesisState) GetLastTransmissionBlockHeight() LastTransmissionBlockHeight { +func (m *GenesisState) GetLastTransmissionBlockHeight() LastTransmissionBlockHeight { if m != nil { return m.LastTransmissionBlockHeight } return LastTransmissionBlockHeight{} } -func (m *PrivateConsumerGenesisState) GetPreCCV() bool { +func (m *GenesisState) GetPreCCV() bool { if m != nil { return m.PreCCV } return false } -func (m *PrivateConsumerGenesisState) GetProvider() types.ProviderInfo { +func (m *GenesisState) GetProvider() types.ProviderInfo { if m != nil { return m.Provider } @@ -166,7 +167,7 @@ func (m *PrivateConsumerGenesisState) GetProvider() types.ProviderInfo { } // HeightValsetUpdateID represents a mapping internal to the consumer CCV module -// AND used in shared consumer genesis state, which links a block height to each recv valset update id. +// which links a block height to each recv valset update id. type HeightToValsetUpdateID struct { Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` ValsetUpdateId uint64 `protobuf:"varint,2,opt,name=valset_update_id,json=valsetUpdateId,proto3" json:"valset_update_id,omitempty"` @@ -219,9 +220,9 @@ func (m *HeightToValsetUpdateID) GetValsetUpdateId() uint64 { return 0 } -// OutstandingDowntime defines the type used internally to the consumer CCV module, -// AND used in shared consumer genesis state, in order to not send multiple slashing -// requests for the same downtime infraction. +// OutstandingDowntime defines the type used internally to the consumer CCV +// module and is used in order to not send multiple slashing requests for +// the same downtime infraction. type OutstandingDowntime struct { ValidatorConsensusAddress string `protobuf:"bytes,1,opt,name=validator_consensus_address,json=validatorConsensusAddress,proto3" json:"validator_consensus_address,omitempty"` } @@ -268,7 +269,7 @@ func (m *OutstandingDowntime) GetValidatorConsensusAddress() string { // LastTransmissionBlockHeight is the last time validator holding // pools were transmitted to the provider chain. This type is used internally -// to the consumer CCV module AND used in shared consumer genesis state. +// to the consumer CCV modul. type LastTransmissionBlockHeight struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` } @@ -314,9 +315,8 @@ func (m *LastTransmissionBlockHeight) GetHeight() int64 { } // MaturingVSCPacket represents a vsc packet that is maturing internal to the -// consumer CCV module, where the consumer has not yet relayed a VSCMatured packet -// back to the provider. This type is used internally to the consumer CCV module -// AND used in shared consumer genesis state. +// consumer CCV module, where the consumer has not yet relayed a VSCMatured +// packet back to the provider. type MaturingVSCPacket struct { VscId uint64 `protobuf:"varint,1,opt,name=vscId,proto3" json:"vscId,omitempty"` MaturityTime time.Time `protobuf:"bytes,2,opt,name=maturity_time,json=maturityTime,proto3,stdtime" json:"maturity_time"` @@ -372,9 +372,7 @@ func (m *MaturingVSCPacket) GetMaturityTime() time.Time { // ConsumerPacketDataList is a list of consumer packet data packets. // // Note this type is is used internally to the consumer CCV module -// for exporting / importing state in InitGenesis and ExportGenesis, -// AND included in the consumer genesis type (reffed by provider and consumer modules), -// hence this is a shared type. +// for exporting / importing state in InitGenesis and ExportGenesis. type ConsumerPacketDataList struct { List []types.ConsumerPacketData `protobuf:"bytes,1,rep,name=list,proto3" json:"list"` } @@ -420,7 +418,7 @@ func (m *ConsumerPacketDataList) GetList() []types.ConsumerPacketData { } func init() { - proto.RegisterType((*PrivateConsumerGenesisState)(nil), "interchain_security.ccv.consumer.v1.PrivateConsumerGenesisState") + proto.RegisterType((*GenesisState)(nil), "interchain_security.ccv.consumer.v1.GenesisState") proto.RegisterType((*HeightToValsetUpdateID)(nil), "interchain_security.ccv.consumer.v1.HeightToValsetUpdateID") proto.RegisterType((*OutstandingDowntime)(nil), "interchain_security.ccv.consumer.v1.OutstandingDowntime") proto.RegisterType((*LastTransmissionBlockHeight)(nil), "interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight") @@ -433,60 +431,60 @@ func init() { } var fileDescriptor_2db73a6057a27482 = []byte{ - // 799 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xdf, 0x6b, 0xeb, 0x36, - 0x14, 0x8e, 0x6f, 0x73, 0x53, 0x47, 0xb9, 0xb7, 0x4b, 0xd5, 0x12, 0xbc, 0x84, 0xa5, 0x21, 0x63, - 0x10, 0xc6, 0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0x94, 0xf9, 0x72, - 0xf1, 0x14, 0xa4, 0x07, 0xd6, 0xef, 0x4f, 0xdf, 0x2b, 0x71, 0x1d, 0x61, 0x3e, 0xab, 0xc8, 0x42, - 0x0f, 0x3e, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x4e, 0xae, 0x09, 0xe0, 0x06, 0x00, 0x00, -} - -func (m *PrivateConsumerGenesisState) Marshal() (dAtA []byte, err error) { + // 791 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcd, 0x6e, 0xf3, 0x44, + 0x14, 0x8d, 0xbf, 0xe6, 0x4b, 0x9d, 0x49, 0x5b, 0xd2, 0x69, 0x15, 0x99, 0x44, 0xa4, 0x51, 0x10, + 0x52, 0x84, 0xc0, 0x26, 0xad, 0x40, 0x48, 0x08, 0x04, 0x49, 0x25, 0x9a, 0xa8, 0x88, 0x2a, 0xfd, + 0x41, 0xea, 0xc6, 0x9a, 0xd8, 0x53, 0x7b, 0x54, 0x7b, 0xc6, 0xf2, 0x8c, 0x1d, 0x2a, 0xc4, 0x86, + 0x2d, 0x9b, 0xbe, 0x12, 0xbb, 0x2e, 0xbb, 0x64, 0x05, 0xa8, 0x7d, 0x11, 0xe4, 0xf1, 0x38, 0x69, + 0xd5, 0xb4, 0xca, 0x2e, 0xe3, 0x7b, 0xee, 0xb9, 0xe7, 0xfe, 0x06, 0xf4, 0x09, 0x15, 0x38, 0x76, + 0x7c, 0x44, 0xa8, 0xcd, 0xb1, 0x93, 0xc4, 0x44, 0xdc, 0x58, 0x8e, 0x93, 0x5a, 0x0e, 0xa3, 0x3c, + 0x09, 0x71, 0x6c, 0xa5, 0x7d, 0xcb, 0xc3, 0x14, 0x73, 0xc2, 0xcd, 0x28, 0x66, 0x82, 0xc1, 0x8f, + 0x97, 0xb8, 0x98, 0x8e, 0x93, 0x9a, 0x85, 0x8b, 0x99, 0xf6, 0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f, 0xff, 0xdd, 0xd3, 0x26, + 0x1b, 0x85, 0x6b, 0x66, 0xec, 0x4e, 0x41, 0x63, 0xf9, 0x6c, 0xc2, 0x23, 0x50, 0x0e, 0x08, 0xcf, + 0x54, 0x66, 0x5b, 0x66, 0xae, 0x76, 0x2a, 0x0b, 0x06, 0xd5, 0x59, 0xc9, 0x30, 0xf8, 0xe5, 0xee, + 0xa1, 0xad, 0xdd, 0x3f, 0xb4, 0xb5, 0xff, 0x1e, 0xda, 0xda, 0xed, 0x63, 0xbb, 0x74, 0xff, 0xd8, + 0x2e, 0xfd, 0xfd, 0xd8, 0x2e, 0x5d, 0x7e, 0xeb, 0x11, 0xe1, 0x27, 0x53, 0xd3, 0x61, 0xa1, 0xe5, + 0x30, 0x1e, 0x32, 0x6e, 0x2d, 0xc2, 0x7c, 0x3e, 0xbf, 0xfd, 0xe9, 0x81, 0xf5, 0xeb, 0xf3, 0x3f, + 0x28, 0x71, 0x13, 0x61, 0x3e, 0xad, 0xc8, 0x44, 0x0f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x80, + 0x85, 0x06, 0x29, 0xd1, 0x06, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -496,12 +494,12 @@ func (m *PrivateConsumerGenesisState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PrivateConsumerGenesisState) MarshalTo(dAtA []byte) (int, error) { +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PrivateConsumerGenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -800,7 +798,7 @@ func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *PrivateConsumerGenesisState) Size() (n int) { +func (m *GenesisState) Size() (n int) { if m == nil { return 0 } @@ -924,7 +922,7 @@ func sovGenesis(x uint64) (n int) { func sozGenesis(x uint64) (n int) { return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *PrivateConsumerGenesisState) Unmarshal(dAtA []byte) error { +func (m *GenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -947,10 +945,10 @@ func (m *PrivateConsumerGenesisState) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PrivateConsumerGenesisState: wiretype end group for non-group") + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PrivateConsumerGenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/ccv/consumer/types/genesis_test.go b/x/ccv/consumer/types/genesis_test.go index f8d4106013..d36ec5deb0 100644 --- a/x/ccv/consumer/types/genesis_test.go +++ b/x/ccv/consumer/types/genesis_test.go @@ -53,39 +53,39 @@ func TestValidateInitialGenesisState(t *testing.T) { cases := []struct { name string - gs *types.PrivateConsumerGenesisState + gs *types.GenesisState expError bool }{ { "valid new consumer genesis state", - types.NewPrivateInitialConsumerGenesisState(cs, consensusState, valUpdates, params), + types.NewInitialGenesisState(cs, consensusState, valUpdates, params), false, }, { "invalid new consumer genesis state: nil client state", - types.NewPrivateInitialConsumerGenesisState(nil, consensusState, valUpdates, params), + types.NewInitialGenesisState(nil, consensusState, valUpdates, params), true, }, { "invalid new consumer genesis state: invalid client state", - types.NewPrivateInitialConsumerGenesisState(&ibctmtypes.ClientState{ChainId: "badClientState"}, + types.NewInitialGenesisState(&ibctmtypes.ClientState{ChainId: "badClientState"}, consensusState, valUpdates, params), true, }, { "invalid new consumer genesis state: nil consensus state", - types.NewPrivateInitialConsumerGenesisState(cs, nil, valUpdates, params), + types.NewInitialGenesisState(cs, nil, valUpdates, params), true, }, { "invalid new consumer genesis state: invalid consensus state", - types.NewPrivateInitialConsumerGenesisState(cs, &ibctmtypes.ConsensusState{Timestamp: time.Now()}, + types.NewInitialGenesisState(cs, &ibctmtypes.ConsensusState{Timestamp: time.Now()}, valUpdates, params), true, }, { "invalid new consumer genesis state: client id not empty", - &types.PrivateConsumerGenesisState{ + &types.GenesisState{ Params: params, ProviderClientId: "ccvclient", ProviderChannelId: "", @@ -105,7 +105,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: channel id not empty", - &types.PrivateConsumerGenesisState{ + &types.GenesisState{ Params: params, ProviderClientId: "", ProviderChannelId: "ccvchannel", @@ -125,7 +125,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: non-empty unbonding sequences", - &types.PrivateConsumerGenesisState{ + &types.GenesisState{ Params: params, ProviderClientId: "", ProviderChannelId: "", @@ -145,7 +145,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: non-empty last transmission packet", - &types.PrivateConsumerGenesisState{ + &types.GenesisState{ Params: params, ProviderClientId: "", ProviderChannelId: "", @@ -165,7 +165,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: non-empty pending consumer packets", - &types.PrivateConsumerGenesisState{ + &types.GenesisState{ Params: params, ProviderClientId: "", ProviderChannelId: "", @@ -185,12 +185,12 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: nil initial validator set", - types.NewPrivateInitialConsumerGenesisState(cs, consensusState, nil, params), + types.NewInitialGenesisState(cs, consensusState, nil, params), true, }, { "invalid new consumer genesis state: invalid consensus state validator set hash", - types.NewPrivateInitialConsumerGenesisState( + types.NewInitialGenesisState( cs, ibctmtypes.NewConsensusState( time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), []byte("wrong_length_hash")), valUpdates, params), @@ -198,7 +198,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: initial validator set does not match validator set hash", - types.NewPrivateInitialConsumerGenesisState( + types.NewInitialGenesisState( cs, ibctmtypes.NewConsensusState( time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), []byte("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")), valUpdates, params), @@ -206,7 +206,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: initial validator set does not match validator set hash", - types.NewPrivateInitialConsumerGenesisState( + types.NewInitialGenesisState( cs, ibctmtypes.NewConsensusState( time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), []byte("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")), valUpdates, params), @@ -214,7 +214,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: invalid params - ccvTimeoutPeriod", - types.NewPrivateInitialConsumerGenesisState(cs, consensusState, valUpdates, + types.NewInitialGenesisState(cs, consensusState, valUpdates, ccv.NewParams( true, ccv.DefaultBlocksPerDistributionTransmission, @@ -233,7 +233,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: invalid params - distributionTransmissionChannel", - types.NewPrivateInitialConsumerGenesisState(cs, consensusState, valUpdates, + types.NewInitialGenesisState(cs, consensusState, valUpdates, ccv.NewParams( true, ccv.DefaultBlocksPerDistributionTransmission, @@ -305,25 +305,25 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) { cases := []struct { name string - gs *types.PrivateConsumerGenesisState + gs *types.GenesisState expError bool }{ { "valid restart consumer genesis state: empty maturing packets", - types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", nil, valUpdates, heightToValsetUpdateID, + types.NewRestartGenesisState("ccvclient", "ccvchannel", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{List: []ccv.ConsumerPacketData{matConsumerPacket, slashConsumerPacket}}, nil, types.LastTransmissionBlockHeight{Height: 100}, params), false, }, { "valid restart consumer genesis state: handshake in progress ", - types.NewRestartConsumerGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, + types.NewRestartGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{List: []ccv.ConsumerPacketData{slashConsumerPacket}}, nil, types.LastTransmissionBlockHeight{}, params), false, }, { "valid restart consumer genesis state: maturing packets", - types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ + types.NewRestartGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ {VscId: 1, MaturityTime: time.Now().UTC()}, {VscId: 3, MaturityTime: time.Now().UTC()}, {VscId: 5, MaturityTime: time.Now().UTC()}, @@ -334,26 +334,26 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) { }, { "invalid restart consumer genesis state: provider id is empty", - types.NewRestartConsumerGenesisState("", "ccvchannel", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), + types.NewRestartGenesisState("", "ccvchannel", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: maturing packet vscId is invalid", - types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ + types.NewRestartGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ {VscId: 0, MaturityTime: time.Now().UTC()}, }, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: maturing packet time is invalid", - types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ + types.NewRestartGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ {VscId: 1, MaturityTime: time.Time{}}, }, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis: client state defined", - &types.PrivateConsumerGenesisState{ + &types.GenesisState{ Params: params, ProviderClientId: "ccvclient", ProviderChannelId: "ccvchannel", @@ -374,7 +374,7 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) { }, { "invalid restart consumer genesis: consensus state defined", - &types.PrivateConsumerGenesisState{ + &types.GenesisState{ Params: params, ProviderClientId: "ccvclient", ProviderChannelId: "ccvchannel", @@ -395,37 +395,37 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) { }, { "invalid restart consumer genesis state: nil initial validator set", - types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", nil, nil, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), + types.NewRestartGenesisState("ccvclient", "ccvchannel", nil, nil, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: nil height to validator set id mapping", - types.NewRestartConsumerGenesisState("ccvclient", "", + types.NewRestartGenesisState("ccvclient", "", []types.MaturingVSCPacket{{VscId: 1, MaturityTime: time.Time{}}}, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: maturing packet defined when handshake is still in progress", - types.NewRestartConsumerGenesisState("ccvclient", "", + types.NewRestartGenesisState("ccvclient", "", []types.MaturingVSCPacket{{VscId: 1, MaturityTime: time.Time{}}}, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: outstanding downtime defined when handshake is still in progress", - types.NewRestartConsumerGenesisState("ccvclient", "", + types.NewRestartGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, []types.OutstandingDowntime{{ValidatorConsensusAddress: "cosmosvalconsxxx"}}, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: last transmission block height defined when handshake is still in progress", - types.NewRestartConsumerGenesisState("ccvclient", "", + types.NewRestartGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{Height: int64(1)}, params), true, }, { "invalid restart consumer genesis state: pending maturing packets defined when handshake is still in progress", - types.NewRestartConsumerGenesisState("ccvclient", "", + types.NewRestartGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{ List: []ccv.ConsumerPacketData{ { @@ -438,7 +438,7 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) { }, { "invalid restart consumer genesis state: invalid params", - types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", nil, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, + types.NewRestartGenesisState("ccvclient", "ccvchannel", nil, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, ccv.NewParams( true, ccv.DefaultBlocksPerDistributionTransmission, diff --git a/x/ccv/types/shared_consumer.pb.go b/x/ccv/types/shared_consumer.pb.go index cf68e9c0d0..c918dd2a3a 100644 --- a/x/ccv/types/shared_consumer.pb.go +++ b/x/ccv/types/shared_consumer.pb.go @@ -32,7 +32,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // ConsumerParams defines the parameters for CCV consumer module. // // Note this type is referenced in both the consumer and provider CCV modules, -// and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. +// and persisted on the provider, see MakeConsumerGenesis and +// SetConsumerGenesis. type ConsumerParams struct { // TODO: Remove enabled flag and find a better way to setup integration tests // See: https://github.com/cosmos/interchain-security/issues/339 @@ -194,7 +195,8 @@ func (m *ConsumerParams) GetProviderRewardDenoms() []string { return nil } -// ConsumerGenesisState defines shared genesis information between provider and consumer +// ConsumerGenesisState defines shared genesis information between provider and +// consumer type ConsumerGenesisState struct { Params ConsumerParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` Provider ProviderInfo `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider"`