Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
change epoch id
Browse files Browse the repository at this point in the history
  • Loading branch information
taryune committed Sep 20, 2023
1 parent e3d6229 commit 0096e16
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions x/epochs/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
type MockHooks struct{}

const (
EpochIdentifier = types.DayEpochId
EpochIdentifier = types.DailyEpochId
BeforeEpochStartEventType = "BeforeEpochStart"
AfterEpochEndEventType = "AfterEpochEnd"
)
Expand Down Expand Up @@ -73,7 +73,7 @@ func (suite *KeeperTestSuite) TestAfterEpochHooks() {
suite.app.EpochsKeeper.BeginBlocker(suite.ctx)

// Check if curent epoch is expected
epochInfo, found := suite.app.EpochsKeeper.GetEpochInfo(suite.ctx, types.DayEpochId)
epochInfo, found := suite.app.EpochsKeeper.GetEpochInfo(suite.ctx, types.DailyEpochId)
suite.Require().True(found)
suite.Require().Equal(int64(2), epochInfo.CurrentEpoch)
},
Expand Down Expand Up @@ -101,7 +101,7 @@ func (suite *KeeperTestSuite) TestAfterEpochHooks() {
suite.app.EpochsKeeper.BeginBlocker(suite.ctx)

// Check if curent epoch is expected
epochInfo, found := suite.app.EpochsKeeper.GetEpochInfo(suite.ctx, types.DayEpochId)
epochInfo, found := suite.app.EpochsKeeper.GetEpochInfo(suite.ctx, types.DailyEpochId)
suite.Require().True(found)
suite.Require().Equal(int64(2), epochInfo.CurrentEpoch)

Expand All @@ -110,7 +110,7 @@ func (suite *KeeperTestSuite) TestAfterEpochHooks() {
suite.app.EpochsKeeper.BeginBlocker(suite.ctx)

// Check if curent epoch is expected
epochInfo, found = suite.app.EpochsKeeper.GetEpochInfo(suite.ctx, types.DayEpochId)
epochInfo, found = suite.app.EpochsKeeper.GetEpochInfo(suite.ctx, types.DailyEpochId)
suite.Require().True(found)
suite.Require().Equal(int64(3), epochInfo.CurrentEpoch)
},
Expand Down
4 changes: 2 additions & 2 deletions x/epochs/types/epoch_identifier.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package types

const (
WeekEpochId = "week"
DayEpochId = "day"
WeeklyEpochId = "weekly"
DailyEpochId = "daily"
)
8 changes: 4 additions & 4 deletions x/epochs/types/epoch_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (suite *EpochInfoTestSuite) TestValidateEpochInfo() {
{
ErrEpochDurationCannotBeZero,
EpochInfo{
IncentiveEpochId,
DailyEpochId,
time.Now(),
time.Hour * 0,
1,
Expand All @@ -65,7 +65,7 @@ func (suite *EpochInfoTestSuite) TestValidateEpochInfo() {
{
ErrCurrentEpochCannotBeNegative,
EpochInfo{
IncentiveEpochId,
DailyEpochId,
time.Now(),
time.Hour * 24,
-1,
Expand All @@ -78,7 +78,7 @@ func (suite *EpochInfoTestSuite) TestValidateEpochInfo() {
{
ErrCurrentEpochStartHeightCannotBeNegative,
EpochInfo{
IncentiveEpochId,
DailyEpochId,
time.Now(),
time.Hour * 24,
1,
Expand All @@ -91,7 +91,7 @@ func (suite *EpochInfoTestSuite) TestValidateEpochInfo() {
{
nil,
EpochInfo{
IncentiveEpochId,
DailyEpochId,
time.Now(),
time.Hour * 24,
1,
Expand Down
4 changes: 2 additions & 2 deletions x/epochs/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func DefaultGenesis() *GenesisState {
return &GenesisState{
Epochs: []EpochInfo{
{
Identifier: WeekEpochId,
Identifier: WeeklyEpochId,
StartTime: time.Time{},
Duration: time.Hour * 24 * 7,
CurrentEpoch: 0,
Expand All @@ -28,7 +28,7 @@ func DefaultGenesis() *GenesisState {
EpochCountingStarted: false,
},
{
Identifier: DayEpochId,
Identifier: DailyEpochId,
StartTime: time.Time{},
Duration: time.Hour * 24,
CurrentEpoch: 0,
Expand Down
6 changes: 3 additions & 3 deletions x/epochs/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (suite *GenesisTestSuite) TestValidateGenesis() {
&GenesisState{
Epochs: []EpochInfo{
{
Identifier: IncentiveEpochId,
Identifier: DailyEpochId,
StartTime: time.Time{},
Duration: time.Hour * 24 * 7,
CurrentEpoch: 0,
Expand All @@ -55,7 +55,7 @@ func (suite *GenesisTestSuite) TestValidateGenesis() {
&GenesisState{
Epochs: []EpochInfo{
{
Identifier: IncentiveEpochId,
Identifier: DailyEpochId,
StartTime: time.Time{},
Duration: time.Hour * 24 * 7,
CurrentEpoch: 0,
Expand All @@ -64,7 +64,7 @@ func (suite *GenesisTestSuite) TestValidateGenesis() {
EpochCountingStarted: false,
},
{
Identifier: IncentiveEpochId,
Identifier: DailyEpochId,
StartTime: time.Time{},
Duration: time.Hour * 24 * 7,
CurrentEpoch: 0,
Expand Down

0 comments on commit 0096e16

Please sign in to comment.