remove telegram dependency, rely on log alters instead, which indirectly connect to telegram via uptrace
This commit is contained in:
@@ -2,10 +2,8 @@ package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/grassrootseconomics/eth-indexer/internal/telegram"
|
||||
"github.com/grassrootseconomics/eth-tracker/pkg/event"
|
||||
"github.com/lmittmann/w3"
|
||||
"github.com/lmittmann/w3/module/eth"
|
||||
@@ -28,7 +26,7 @@ func (h *Handler) FaucetHealthCheck(ctx context.Context, event event.Event) erro
|
||||
}
|
||||
|
||||
if balance.Cmp(new(big.Int).Mul(w3.BigEther, big.NewInt(balanceThreshold))) < 0 {
|
||||
return h.telegram.Notify(ctx, fmt.Sprintf("%s:\n\n %s", event.ContractAddress, telegram.NOTIFY_LOW_BALANCE_ON_GAS_FAUCET))
|
||||
h.logg.Warn("faucet balance is less than 5 ether", "faucet", event.ContractAddress)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/grassrootseconomics/eth-indexer/internal/cache"
|
||||
"github.com/grassrootseconomics/eth-indexer/internal/store"
|
||||
"github.com/grassrootseconomics/eth-indexer/internal/telegram"
|
||||
"github.com/grassrootseconomics/ethutils"
|
||||
)
|
||||
|
||||
@@ -14,7 +13,6 @@ type (
|
||||
Store store.Store
|
||||
Cache *cache.Cache
|
||||
ChainProvider *ethutils.Provider
|
||||
Telegram *telegram.Telegram
|
||||
Logg *slog.Logger
|
||||
}
|
||||
|
||||
@@ -22,7 +20,6 @@ type (
|
||||
store store.Store
|
||||
cache *cache.Cache
|
||||
chainProvider *ethutils.Provider
|
||||
telegram *telegram.Telegram
|
||||
logg *slog.Logger
|
||||
}
|
||||
)
|
||||
@@ -32,7 +29,6 @@ func NewHandler(o HandlerOpts) *Handler {
|
||||
store: o.Store,
|
||||
cache: o.Cache,
|
||||
chainProvider: o.ChainProvider,
|
||||
telegram: o.Telegram,
|
||||
logg: o.Logg,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user