-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: epochs infos missing start time (#438)
- Loading branch information
1 parent
96d8a99
commit acea93f
Showing
3 changed files
with
69 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package migrations | ||
|
||
import ( | ||
"time" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/elys-network/elys/x/epochs/types" | ||
) | ||
|
||
func (m Migrator) V3Migration(ctx sdk.Context) error { | ||
// twelve hours | ||
m.keeper.SetEpochInfo(ctx, types.EpochInfo{ | ||
Identifier: "twelvehours", | ||
Duration: time.Hour * 12, | ||
CurrentEpoch: 0, | ||
CurrentEpochStartHeight: 0, | ||
EpochCountingStarted: false, | ||
CurrentEpochStartTime: time.Now(), | ||
StartTime: time.Now(), | ||
}) | ||
|
||
// six hours | ||
m.keeper.SetEpochInfo(ctx, types.EpochInfo{ | ||
Identifier: "sixhours", | ||
Duration: time.Hour * 6, | ||
CurrentEpoch: 0, | ||
CurrentEpochStartHeight: 0, | ||
EpochCountingStarted: false, | ||
CurrentEpochStartTime: time.Now(), | ||
StartTime: time.Now(), | ||
}) | ||
|
||
// four hours | ||
m.keeper.SetEpochInfo(ctx, types.EpochInfo{ | ||
Identifier: "fourhours", | ||
Duration: time.Hour * 4, | ||
CurrentEpoch: 0, | ||
CurrentEpochStartHeight: 0, | ||
EpochCountingStarted: false, | ||
CurrentEpochStartTime: time.Now(), | ||
StartTime: time.Now(), | ||
}) | ||
|
||
// two hours | ||
m.keeper.SetEpochInfo(ctx, types.EpochInfo{ | ||
Identifier: "twohours", | ||
Duration: time.Hour * 2, | ||
CurrentEpoch: 0, | ||
CurrentEpochStartHeight: 0, | ||
EpochCountingStarted: false, | ||
CurrentEpochStartTime: time.Now(), | ||
StartTime: time.Now(), | ||
}) | ||
|
||
// half hour | ||
m.keeper.SetEpochInfo(ctx, types.EpochInfo{ | ||
Identifier: "halfhour", | ||
Duration: time.Minute * 30, | ||
CurrentEpoch: 0, | ||
CurrentEpochStartHeight: 0, | ||
EpochCountingStarted: false, | ||
CurrentEpochStartTime: time.Now(), | ||
StartTime: time.Now(), | ||
}) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters