Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
boojamya committed Feb 16, 2024
1 parent c9a6173 commit bb94d42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,25 @@ func filterLowTransfers(cfg *types.Config, logger log.Logger, msg *types.Message
var minBurnAmount uint64
if msg.DestDomain == types.Domain(4) {
minBurnAmount = cfg.Chains["noble"].(*noble.ChainConfig).MinAmount
logger.Info("CHAIN: Noble", "min burn amount: ", minBurnAmount)
} else {
for _, chain := range cfg.Chains {
for name, chain := range cfg.Chains {
c, ok := chain.(*ethereum.ChainConfig)
if !ok {
// noble chain, handled above
continue
}
if c.Domain == msg.DestDomain {
minBurnAmount = c.MinAmount
logger.Info("ETCH CHAIN", "chain", name, "min burn amount:", minBurnAmount)
}
}
}

if bm.Amount.LT(math.NewIntFromUint64(minBurnAmount)) {
logger.Info(
"Filtered tx because the transfer amount is less than the minimum allowed amount",
"dest domain", msg.DestDomain,
"source_domain", msg.SourceDomain,
"source_tx", msg.SourceTxHash,
"amount", bm.Amount,
Expand All @@ -225,6 +228,7 @@ func filterLowTransfers(cfg *types.Config, logger log.Logger, msg *types.Message

logger.Info(
"Not filtering tx due to low transfer amount",
"dest domain", msg.DestDomain,
"source_domain", msg.SourceDomain,
"source_tx", msg.SourceTxHash,
"amount", bm.Amount.Uint64(),
Expand Down

0 comments on commit bb94d42

Please sign in to comment.