Skip to content

Commit 22561c4

Browse files
authored
Merge pull request #591 from tonkeeper/check_event
rename CheckActions
2 parents c990f97 + 598134b commit 22561c4

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

pkg/api/event_converters.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ func (h *Handler) toEvent(ctx context.Context, trace *core.Trace, result *bath.A
805805
}
806806
event.Actions[i] = convertedAction
807807
}
808-
event.IsScam = h.spamFilter.CheckActions(event.Actions, nil, trace.Account)
808+
event.IsScam = h.spamFilter.IsScamEvent(event.EventID, event.Actions, nil, trace.Account)
809809
previews := make(map[tongo.AccountID]oas.JettonPreview)
810810
for _, flow := range result.ValueFlow.Accounts {
811811
for jettonMaster := range flow.Jettons {
@@ -886,7 +886,7 @@ func (h *Handler) toAccountEvent(ctx context.Context, account tongo.AccountID, t
886886
e.Actions = append(e.Actions, convertedAction)
887887
}
888888
if h.spamFilter != nil {
889-
e.IsScam = h.spamFilter.CheckActions(e.Actions, &account, trace.Account)
889+
e.IsScam = h.spamFilter.IsScamEvent(e.EventID, e.Actions, &account, trace.Account)
890890
}
891891
if len(e.Actions) == 0 {
892892
e.Actions = []oas.Action{

pkg/api/interfaces.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ type scoreSource interface {
184184
}
185185

186186
type SpamFilter interface {
187-
CheckActions(actions []oas.Action, viewer *ton.AccountID, initiator ton.AccountID) bool
187+
IsScamEvent(eventId string, 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
190190
NftTrust(ctx context.Context, address tongo.AccountID, collection *ton.AccountID, description, image string) core.TrustType

pkg/api/jetton_converters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (h *Handler) convertJettonHistory(ctx context.Context, account ton.AccountI
9797
}
9898
event.Actions = append(event.Actions, convertedAction)
9999
}
100-
event.IsScam = h.spamFilter.CheckActions(event.Actions, &account, trace.Account)
100+
event.IsScam = h.spamFilter.IsScamEvent(event.EventID, event.Actions, &account, trace.Account)
101101
if len(event.Actions) == 0 {
102102
continue
103103
}

pkg/api/nft_converters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (h *Handler) convertNftHistory(ctx context.Context, account tongo.AccountID
163163
}
164164
event.Actions = append(event.Actions, convertedAction)
165165
}
166-
event.IsScam = h.spamFilter.CheckActions(event.Actions, &account, trace.Account)
166+
event.IsScam = h.spamFilter.IsScamEvent(event.EventID, event.Actions, &account, trace.Account)
167167
if len(event.Actions) > 0 {
168168
events = append(events, event)
169169
lastLT = trace.Lt

pkg/spam/spam.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func NewSpamFilter() *Filter {
1919
}
2020
}
2121

22-
func (f Filter) CheckActions(actions []oas.Action, viewer *ton.AccountID, initiator ton.AccountID) bool {
22+
func (f Filter) IsScamEvent(eventId string, actions []oas.Action, viewer *ton.AccountID, initiator ton.AccountID) bool {
2323
var comment string
2424
for _, action := range actions {
2525
switch {

0 commit comments

Comments
 (0)