Skip to content

Commit

Permalink
Replace .Str()+strconv.Format() in logs with .Uint32 for uint32 types (
Browse files Browse the repository at this point in the history
  • Loading branch information
kirugan authored Jan 16, 2025
1 parent d226846 commit e3195ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/services/delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (s *Service) processCovenantQuorumReachedEvent(
if newState == types.StateActive {
log.Debug().
Str("staking_tx", covenantQuorumReachedEvent.StakingTxHash).
Str("staking_start_height", strconv.FormatUint(uint64(delegation.StartHeight), 10)).
Uint32("staking_start_height", delegation.StartHeight).
Stringer("event_type", EventCovenantQuorumReached).
Msg("handling active state")

Expand Down Expand Up @@ -343,8 +343,8 @@ func (s *Service) processBTCDelegationUnbondedEarlyEvent(
Stringer("current_state", delegation.State).
Stringer("new_state", types.StateUnbonding).
Str("early_unbonding_start_height", unbondedEarlyEvent.StartHeight).
Str("unbonding_time", strconv.FormatUint(uint64(delegation.UnbondingTime), 10)).
Str("unbonding_expire_height", strconv.FormatUint(uint64(unbondingExpireHeight), 10)).
Uint32("unbonding_time", delegation.UnbondingTime).
Uint32("unbonding_expire_height", unbondingExpireHeight).
Stringer("sub_state", subState).
Stringer("event_type", EventBTCDelgationUnbondedEarly).
Msg("updating delegation state")
Expand Down
4 changes: 1 addition & 3 deletions internal/services/expiry_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"context"
"fmt"
"net/http"
"strconv"

"github.com/babylonlabs-io/babylon-staking-indexer/internal/db"
"github.com/babylonlabs-io/babylon-staking-indexer/internal/types"
"github.com/babylonlabs-io/babylon-staking-indexer/internal/utils/poller"
Expand Down Expand Up @@ -49,7 +47,7 @@ func (s *Service) checkExpiry(ctx context.Context) *types.Error {
Str("staking_tx", delegation.StakingTxHashHex).
Stringer("current_state", delegation.State).
Stringer("new_sub_state", tlDoc.DelegationSubState).
Str("expire_height", strconv.FormatUint(uint64(tlDoc.ExpireHeight), 10)).
Uint32("expire_height", tlDoc.ExpireHeight).
Msg("checking if delegation is expired")

stateUpdateErr := s.db.UpdateBTCDelegationState(
Expand Down

0 comments on commit e3195ae

Please sign in to comment.