Skip to content

Commit

Permalink
test: more test
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt committed Jul 21, 2023
1 parent 4d077d9 commit c36f801
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions x/epochs/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,44 @@ func TestGenesisState_Validate(t *testing.T) {
})
}
}

func TestGenesisState_HappyPath(t *testing.T) {
tests := []struct {
name string
genState GenesisState
}{
{
name: "duplicate epochinfo",
genState: GenesisState{
Epochs: []EpochInfo{
{
Identifier: "firstOne",
StartTime: time.Now(),
Duration: 10,
CurrentEpoch: 2,
CurrentEpochStartTime: time.Now(),
EpochCountingStarted: false,
CurrentEpochStartHeight: 1,
},
{
Identifier: "someOther",
StartTime: time.Now(),
Duration: 10,
CurrentEpoch: 2,
CurrentEpochStartTime: time.Now(),
EpochCountingStarted: false,
CurrentEpochStartHeight: 1,
},
},
},
},
}

for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
err := tc.genState.Validate()
require.NoError(t, err)
})
}
}

0 comments on commit c36f801

Please sign in to comment.