From a6039bcdc73074418c964a496d3ea9d4ce7c191c Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Fri, 5 Apr 2024 18:58:54 +0700 Subject: [PATCH] fix(x/epochs): Fix init genesis (#19958) --- x/epochs/keeper/epoch.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/epochs/keeper/epoch.go b/x/epochs/keeper/epoch.go index 660d60fd7e..de5f0f51f9 100644 --- a/x/epochs/keeper/epoch.go +++ b/x/epochs/keeper/epoch.go @@ -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) }