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

This commit is contained in:
Hieu Vu 2024-04-05 18:58:54 +07:00 committed by GitHub
parent 60496848d9
commit a6039bcdc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)
}