Skip to content

Commit

Permalink
make log printing less verbose on unsupported chain or invalid chain …
Browse files Browse the repository at this point in the history
…params
  • Loading branch information
ws4charlie committed Apr 2, 2024
1 parent d924777 commit 8b54078
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zetaclient/zetabridge/zetacore_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,15 @@ func (b *ZetaCoreBridge) UpdateZetaCoreContext(coreContext *corecontext.ZetaCore
var newBTCParams *observertypes.ChainParams

// check and update chain params for each chain
sampledLogger := b.logger.Sample(&zerolog.BasicSampler{N: 10})

Check warning on line 223 in zetaclient/zetabridge/zetacore_bridge.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/zetabridge/zetacore_bridge.go#L223

Added line #L223 was not covered by tests
for _, chainParam := range chainParams {
if !chainParam.GetIsSupported() {
b.logger.Info().Msgf("Chain %d is not supported yet", chainParam.ChainId)
sampledLogger.Info().Msgf("Chain %d is not supported yet", chainParam.ChainId)

Check warning on line 226 in zetaclient/zetabridge/zetacore_bridge.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/zetabridge/zetacore_bridge.go#L225-L226

Added lines #L225 - L226 were not covered by tests
continue
}
err := observertypes.ValidateChainParams(chainParam)
if err != nil {
b.logger.Warn().Err(err).Msgf("Invalid chain params for chain %d", chainParam.ChainId)
sampledLogger.Warn().Err(err).Msgf("Invalid chain params for chain %d", chainParam.ChainId)

Check warning on line 231 in zetaclient/zetabridge/zetacore_bridge.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/zetabridge/zetacore_bridge.go#L229-L231

Added lines #L229 - L231 were not covered by tests
continue
}
if chains.IsBitcoinChain(chainParam.ChainId) {
Expand Down

0 comments on commit 8b54078

Please sign in to comment.