Skip to content

Commit

Permalink
Improved logs and descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszslabon committed Jun 10, 2024
1 parent c0d6f92 commit cddb143
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/tbtc/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ type DKGParameters struct {
ApprovePrecedencePeriodBlocks uint64
}

// WalletClosedEvent represents a wallet closed. It is emitted when the wallet
// is closed in the wallet registry.
// WalletClosedEvent represents a wallet closed event. It is emitted when the
// wallet is closed in the wallet registry.
type WalletClosedEvent struct {
WalletID [32]byte
BlockNumber uint64
Expand Down
4 changes: 2 additions & 2 deletions pkg/tbtc/deduplicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const (
// DKGResultHashCachePeriod is the time period the cache maintains
// the given DKG result hash.
DKGResultHashCachePeriod = 7 * 24 * time.Hour
// WalletClosedCachePeriod is the time period the cache maintains
// the given wallet closed hash.
// WalletClosedCachePeriod is the time period the cache maintains the ID of
// a closed wallet.
WalletClosedCachePeriod = 7 * 24 * time.Hour
)

Expand Down
9 changes: 5 additions & 4 deletions pkg/tbtc/tbtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,17 @@ func Initialize(
event.WalletID,
); !ok {
logger.Warnf(
"Wallet closure for wallet with ID [0x%x] at block [%v] has"+
"been already processed",
"Wallet closure for wallet with ID [0x%x] at block [%v] "+
"has been already processed",
event.WalletID,
event.BlockNumber,
)
return
}

logger.Infof(
"Wallet with ID [0x%x] has been closed at block [%v]",
"Wallet with ID [0x%x] has been closed at block [%v]; "+
"proceeding with handling wallet closure",
event.WalletID,
event.BlockNumber,
)
Expand All @@ -289,7 +290,7 @@ func Initialize(
)
if err != nil {
logger.Errorf(
"Failure while handling wallet with ID [0x%x]: [%v]",
"Failure while handling wallet closure with ID [0x%x]: [%v]",
event.WalletID,
err,
)
Expand Down

0 comments on commit cddb143

Please sign in to comment.