mirror of
https://github.com/status-im/status-go.git
synced 2025-01-10 14:47:06 +00:00
8e63f44735
Main changes: - Refactor activity API to propagate token identities. - Extend service to convert token identities to symbols for filtering multi-transaction - Filter transfers, pending_transactions and multi-transactions based on the provided token identities - Return involved token identities in activity API - Test token filtering Also: - Fixed calling cancel on a filer activity completed task to release resources Notes: - Found limitations with the token identity which complicates things by not allowing to filter by token groups (like token-code does) Updates status-desktop #11025
25 lines
420 B
Go
25 lines
420 B
Go
package testutils
|
|
|
|
import "reflect"
|
|
|
|
const EthSymbol = "ETH"
|
|
const SntSymbol = "SNT"
|
|
const DaiSymbol = "DAI"
|
|
|
|
func SliceContains[T comparable](slice []T, value T) bool {
|
|
for _, v := range slice {
|
|
if v == value {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
func StructExistsInSlice[T any](target T, slice []T) bool {
|
|
for _, item := range slice {
|
|
if reflect.DeepEqual(target, item) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|