Skip to content

Commit

Permalink
fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoke committed Oct 20, 2024
1 parent db54129 commit 5d4b6d8
Showing 1 changed file with 0 additions and 58 deletions.
58 changes: 0 additions & 58 deletions x/ccv/consumer/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func TestValidateInitialGenesisState(t *testing.T) {
ConsensusState: consensusState,
InitialValSet: valUpdates,
},
MaturingPackets: nil,
HeightToValsetUpdateId: nil,
OutstandingDowntimeSlashing: nil,
PendingConsumerPackets: types.ConsumerPacketDataList{},
Expand All @@ -115,28 +114,6 @@ func TestValidateInitialGenesisState(t *testing.T) {
ConsensusState: consensusState,
InitialValSet: valUpdates,
},
MaturingPackets: nil,
HeightToValsetUpdateId: nil,
OutstandingDowntimeSlashing: nil,
PendingConsumerPackets: types.ConsumerPacketDataList{},
LastTransmissionBlockHeight: types.LastTransmissionBlockHeight{},
PreCCV: false,
},
true,
},
{
"invalid new consumer genesis state: non-empty unbonding sequences",
&types.GenesisState{
Params: params,
ProviderClientId: "",
ProviderChannelId: "",
NewChain: true,
Provider: ccv.ProviderInfo{
ClientState: cs,
ConsensusState: consensusState,
InitialValSet: valUpdates,
},
MaturingPackets: []types.MaturingVSCPacket{{}},
HeightToValsetUpdateId: nil,
OutstandingDowntimeSlashing: nil,
PendingConsumerPackets: types.ConsumerPacketDataList{},
Expand All @@ -157,7 +134,6 @@ func TestValidateInitialGenesisState(t *testing.T) {
ConsensusState: consensusState,
InitialValSet: valUpdates,
},
MaturingPackets: nil,
HeightToValsetUpdateId: nil,
OutstandingDowntimeSlashing: nil,
PendingConsumerPackets: types.ConsumerPacketDataList{},
Expand All @@ -178,7 +154,6 @@ func TestValidateInitialGenesisState(t *testing.T) {
ConsensusState: consensusState,
InitialValSet: valUpdates,
},
MaturingPackets: nil,
HeightToValsetUpdateId: nil,
OutstandingDowntimeSlashing: nil,
PendingConsumerPackets: types.ConsumerPacketDataList{List: []ccv.ConsumerPacketData{{}}},
Expand Down Expand Up @@ -281,13 +256,6 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) {
valHash := valSet.Hash()
valUpdates := tmtypes.TM2PB.ValidatorUpdates(valSet)

matConsumerPacket := ccv.ConsumerPacketData{
Type: ccv.VscMaturedPacket,
Data: &ccv.ConsumerPacketData_VscMaturedPacketData{
VscMaturedPacketData: ccv.NewVSCMaturedPacketData(1),
},
}

slashConsumerPacket := ccv.ConsumerPacketData{
Type: ccv.SlashPacket,
Data: &ccv.ConsumerPacketData_SlashPacketData{
Expand All @@ -314,13 +282,6 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) {
gs *types.GenesisState
expError bool
}{
{
"valid restart consumer genesis state: empty maturing packets",
types.NewRestartGenesisState("ccvclient", "ccvchannel", 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.NewRestartGenesisState("ccvclient", "", valUpdates, heightToValsetUpdateID,
Expand Down Expand Up @@ -377,12 +338,6 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) {
types.NewRestartGenesisState("ccvclient", "ccvchannel", nil, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params),
true,
},
{
"invalid restart consumer genesis state: nil height to validator set id mapping",
types.NewRestartGenesisState("ccvclient", "",
valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params),
true,
},
{
"invalid restart consumer genesis state: outstanding downtime defined when handshake is still in progress",
types.NewRestartGenesisState("ccvclient", "",
Expand All @@ -396,19 +351,6 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) {
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.NewRestartGenesisState("ccvclient", "",
valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{
List: []ccv.ConsumerPacketData{
{
Type: ccv.VscMaturedPacket,
Data: &ccv.ConsumerPacketData_VscMaturedPacketData{VscMaturedPacketData: ccv.NewVSCMaturedPacketData(1)},
},
},
}, nil, types.LastTransmissionBlockHeight{Height: int64(1)}, params),
true,
},
{
"invalid restart consumer genesis state: invalid params",
types.NewRestartGenesisState("ccvclient", "ccvchannel", valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{},
Expand Down

0 comments on commit 5d4b6d8

Please sign in to comment.