Skip to content

Commit

Permalink
Problem: black list addresses are not logged
Browse files Browse the repository at this point in the history
Update app/app.go

Signed-off-by: yihuang <huang@crypto.com>

update log
  • Loading branch information
yihuang committed Feb 26, 2024
1 parent 97b015c commit 75eaec1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package app

import (
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"io"
Expand Down Expand Up @@ -800,6 +802,22 @@ func New(

// use Ethermint's custom AnteHandler
func (app *App) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64, blacklist []string) {
if len(blacklist) > 0 {
// hash blacklist concatenated
h := sha256.New()
for _, addr := range blacklist {
_, err := h.Write([]byte(addr))
if err != nil {
panic(err)
}
}
app.Logger().Info("Setting ante handler with blacklist", "size", len(blacklist), "hash", hex.EncodeToString(h.Sum(nil)))
for _, addr := range blacklist {
app.Logger().Info("Blacklisted address", "address", addr)
}
} else {
app.Logger().Info("Setting ante handler without blacklist")
}
anteHandler, err := evmante.NewAnteHandler(evmante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
Expand Down

0 comments on commit 75eaec1

Please sign in to comment.