Skip to content

Commit

Permalink
fix err type
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Jan 13, 2025
1 parent 26552d7 commit 538ce40
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions internal/services/delegation_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,15 @@ import (
func (s *Service) registerUnbondingSpendNotification(
ctx context.Context,
delegation *model.BTCDelegationDetails,
) *types.Error {
) error {
unbondingTxBytes, parseErr := hex.DecodeString(delegation.UnbondingTx)
if parseErr != nil {
return types.NewError(
http.StatusInternalServerError,
types.InternalServiceError,
fmt.Errorf("failed to decode unbonding tx: %w", parseErr),
)
return fmt.Errorf("failed to decode unbonding tx: %w", parseErr)
}

unbondingTx, parseErr := bbn.NewBTCTxFromBytes(unbondingTxBytes)
if parseErr != nil {
return types.NewError(
http.StatusInternalServerError,
types.InternalServiceError,
fmt.Errorf("failed to parse unbonding tx: %w", parseErr),
)
return fmt.Errorf("failed to parse unbonding tx: %w", parseErr)
}

log.Debug().
Expand Down

0 comments on commit 538ce40

Please sign in to comment.