Skip to content

Commit 4aff28a

Browse files
committed
add context to NftTrust
1 parent c274453 commit 4aff28a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pkg/api/interfaces.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ type SpamFilter interface {
187187
CheckActions(actions []oas.Action, viewer *ton.AccountID, initiator ton.AccountID) bool
188188
JettonTrust(address tongo.AccountID, symbol, name, image string) core.TrustType
189189
AccountTrust(address tongo.AccountID) core.TrustType
190-
NftTrust(address tongo.AccountID, collection *ton.AccountID, description, image string) core.TrustType
190+
NftTrust(ctx context.Context, address tongo.AccountID, collection *ton.AccountID, description, image string) core.TrustType
191191
}
192192

193193
type verifierSource interface {

pkg/api/nft_converters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (h *Handler) convertNFT(ctx context.Context, item core.NftItem, book addres
7777
if len(nftItem.ApprovedBy) > 0 && nftItem.Verified {
7878
nftItem.Trust = oas.TrustType(core.TrustWhitelist)
7979
} else {
80-
nftItem.Trust = oas.TrustType(h.spamFilter.NftTrust(item.Address, item.CollectionAddress, description, image))
80+
nftItem.Trust = oas.TrustType(h.spamFilter.NftTrust(ctx, item.Address, item.CollectionAddress, description, image))
8181
}
8282
if image == "" {
8383
image = references.Placeholder

pkg/spam/spam.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package spam
22

33
import (
4+
"context"
45
"github.com/tonkeeper/opentonapi/pkg/core"
56
"github.com/tonkeeper/opentonapi/pkg/oas"
67
rules "github.com/tonkeeper/scam_backoffice_rules"
@@ -46,7 +47,7 @@ func (f Filter) JettonTrust(address tongo.AccountID, symbol, name, image string)
4647
return core.TrustNone
4748
}
4849

49-
func (f Filter) NftTrust(address tongo.AccountID, collection *ton.AccountID, description, image string) core.TrustType {
50+
func (f Filter) NftTrust(ctx context.Context, address tongo.AccountID, collection *ton.AccountID, description, image string) core.TrustType {
5051
return core.TrustNone
5152
}
5253

0 commit comments

Comments
 (0)