From 702646eca997efb4278432da6d489b3fdae33a54 Mon Sep 17 00:00:00 2001 From: Krypto Pank Date: Thu, 17 Feb 2022 09:04:20 +0200 Subject: [PATCH] Move activitiesForThisCard filtering for `aETHMinted` event into loop, to avoid double filtering of array #3953 --- AlphaWallet/Activities/ActivitiesService.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AlphaWallet/Activities/ActivitiesService.swift b/AlphaWallet/Activities/ActivitiesService.swift index 0b26d5eea..7db57f8bd 100644 --- a/AlphaWallet/Activities/ActivitiesService.swift +++ b/AlphaWallet/Activities/ActivitiesService.swift @@ -412,20 +412,20 @@ class ActivitiesService: NSObject, ActivitiesServiceType { } //NOTE: using `tokenHolders[0]` i received crash with out of range exception guard let tokenHolder = tokenHolders.first else { return nil } + //TODO fix for activities: special fix to filter out the event we don't want - need to doc this and have to handle with TokenScript design + let isNativeCryptoAddress = tokenObject.contractAddress.sameContract(as: Constants.nativeCryptoAddressInDatabase) + if card.name == "aETHMinted" && isNativeCryptoAddress && cardAttributes["amount"]?.uintValue == 0 { + return nil + } else { + //no-op + } let activity = Activity(id: Int.random(in: 0..