diff --git a/cmd/stellar-rpc/internal/methods/get_events.go b/cmd/stellar-rpc/internal/methods/get_events.go index 8408ef95..6af8da27 100644 --- a/cmd/stellar-rpc/internal/methods/get_events.go +++ b/cmd/stellar-rpc/internal/methods/get_events.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "math" + "slices" "strings" "time" @@ -221,12 +222,7 @@ func (e *EventFilter) matchesContractIDs(event xdr.ContractEvent) bool { return false } needle := strkey.MustEncode(strkey.VersionByteContract, (*event.ContractId)[:]) - for _, id := range e.ContractIDs { - if id == needle { - return true - } - } - return false + return slices.Contains(e.ContractIDs,needle ) } func (e *EventFilter) matchesTopics(event xdr.ContractEvent) bool {