fix(x/epochs): Fix init genesis (#19958)

This commit is contained in:
Hieu Vu
2024-04-05 11:58:54 +00:00
committed by GitHub
parent 60496848d9
commit a6039bcdc7
+3 -2
View File
@@ -28,8 +28,9 @@ func (k Keeper) AddEpochInfo(ctx context.Context, epoch types.EpochInfo) error {
if epoch.StartTime.IsZero() {
epoch.StartTime = k.environment.HeaderService.GetHeaderInfo(ctx).Time
}
epoch.CurrentEpochStartHeight = k.environment.HeaderService.GetHeaderInfo(ctx).Height
if epoch.CurrentEpochStartHeight == 0 {
epoch.CurrentEpochStartHeight = k.environment.HeaderService.GetHeaderInfo(ctx).Height
}
return k.EpochInfo.Set(ctx, epoch.Identifier, epoch)
}