diff --git a/internal/services/delegation.go b/internal/services/delegation.go index 7d1e1c4..6e90135 100644 --- a/internal/services/delegation.go +++ b/internal/services/delegation.go @@ -374,7 +374,6 @@ func (s *Service) processBTCDelegationExpiredEvent( if err != nil { return err } - if !shouldProcess { // Ignore the event silently return nil diff --git a/internal/services/events.go b/internal/services/events.go index c9dd5a1..5275a06 100644 --- a/internal/services/events.go +++ b/internal/services/events.go @@ -327,16 +327,12 @@ func (s *Service) validateBTCDelegationUnbondedEarlyEvent(ctx context.Context, e // Check if the current state is qualified for the transition if !utils.Contains(types.QualifiedStatesForUnbondedEarly(), delegation.State) { - log.Error(). + log.Debug(). Str("stakingTxHashHex", event.StakingTxHash). Str("currentState", delegation.State.String()). Str("event_type", "EventBTCDelgationUnbondedEarly"). - Msg("Current state is not qualified for transition") - return false, types.NewErrorWithMsg( - http.StatusForbidden, - types.Forbidden, - "current state is not qualified for transition", - ) + Msg("current state is not qualified for transition") + return false, nil } return true, nil @@ -373,16 +369,12 @@ func (s *Service) validateBTCDelegationExpiredEvent(ctx context.Context, event * // Check if the current state is qualified for the transition if !utils.Contains(types.QualifiedStatesForExpired(), delegation.State) { - log.Error(). + log.Debug(). Str("stakingTxHashHex", event.StakingTxHash). Str("currentState", delegation.State.String()). Str("event_type", "EventBTCDelegationExpired"). Msg("current state is not qualified for transition") - return false, types.NewErrorWithMsg( - http.StatusForbidden, - types.Forbidden, - "current state is not qualified for transition", - ) + return false, nil } return true, nil diff --git a/internal/types/state.go b/internal/types/state.go index 4afc97e..a487094 100644 --- a/internal/types/state.go +++ b/internal/types/state.go @@ -69,11 +69,6 @@ func QualifiedStatesForWithdrawable() []DelegationState { return []DelegationState{StateUnbonding, StateSlashed} } -// OutdatedStatesForWithdrawable returns the outdated current states for Withdrawable event -func OutdatedStatesForWithdrawable() []DelegationState { - return []DelegationState{StateWithdrawable, StateWithdrawn} -} - type DelegationSubState string const (