Skip to content

Commit 39d6c89

Browse files
committed
add logs for spam
1 parent ff7ba60 commit 39d6c89

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pkg/api/nft_converters.go

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"errors"
77
"fmt"
8+
"go.uber.org/zap"
89

910
"github.com/tonkeeper/opentonapi/internal/g"
1011
"github.com/tonkeeper/opentonapi/pkg/bath"
@@ -78,6 +79,7 @@ func (h *Handler) convertNFT(ctx context.Context, item core.NftItem, book addres
7879
nftItem.Trust = oas.TrustType(core.TrustWhitelist)
7980
} else {
8081
nftTrust := h.spamFilter.NftTrust(item.Address, item.CollectionAddress, description, image)
82+
h.logger.Warn("convertNft", zap.String("account id", item.Address.ToRaw()), zap.String("nftTrust", string(nftTrust)))
8183
if nftTrust == core.TrustNone && trustType != "" {
8284
nftTrust = trustType
8385
}

pkg/api/nft_handlers.go

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func (h *Handler) GetNftItemByAddress(ctx context.Context, params oas.GetNftItem
7272
return nil, toError(http.StatusNotFound, fmt.Errorf("item not found"))
7373
}
7474
nftScamData, err := h.spamFilter.GetNftsScamData(ctx, []ton.AccountID{account.ID})
75+
h.logger.Warn("GetNftsScamData", zap.Error(err), zap.String("account id", account.ID.ToRaw()), zap.String("value", string(nftScamData[account.ID])))
7576
if err != nil {
7677
h.logger.Warn("error getting nft scam data", zap.Error(err))
7778
}

0 commit comments

Comments
 (0)