java-topology/defects/cake_wallet-0002/patch/cake_wallet-0002.patch

49 lines
2.3 KiB
Diff

# UNDF: UNDF-2026-000000925
--- a/lib/exchange/utils/currency_pairs_utils.dart
+++ b/lib/exchange/utils/currency_pairs_utils.dart
@@ -1,12 +1,13 @@
import 'package:cake_wallet/exchange/exchange_pair.dart';
import 'package:cw_core/crypto_currency.dart';
List<ExchangePair> supportedPairs(List<CryptoCurrency> notSupported) {
+ final notSupportedSet = notSupported.toSet();
final supportedCurrencies =
- CryptoCurrency.all.where((element) => !notSupported.contains(element)).toList();
+ CryptoCurrency.all.where((element) => !notSupportedSet.contains(element)).toList();
return supportedCurrencies
.map((i) => supportedCurrencies.map((k) => ExchangePair(from: i, to: k, reverse: true)))
.expand((i) => i)
.toList();
}
--- a/lib/buy/pairs_utils.dart
+++ b/lib/buy/pairs_utils.dart
@@ -11,8 +11,10 @@
List<TradePair<CryptoCurrency, FiatCurrency>> supportedCryptoToFiatPairs({
required List<CryptoCurrency> notSupportedCrypto,
required List<FiatCurrency> notSupportedFiat,
}) {
+ final notSupportedCryptoSet = notSupportedCrypto.toSet();
+ final notSupportedFiatSet = notSupportedFiat.toSet();
final supportedCrypto =
- CryptoCurrency.all.where((crypto) => !notSupportedCrypto.contains(crypto)).toList();
- final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiat.contains(fiat)).toList();
+ CryptoCurrency.all.where((crypto) => !notSupportedCryptoSet.contains(crypto)).toList();
+ final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiatSet.contains(fiat)).toList();
return supportedCrypto
.expand((crypto) => supportedFiat
@@ -25,8 +27,10 @@
List<TradePair<FiatCurrency, CryptoCurrency>> supportedFiatToCryptoPairs({
required List<FiatCurrency> notSupportedFiat,
required List<CryptoCurrency> notSupportedCrypto,
}) {
- final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiat.contains(fiat)).toList();
+ final notSupportedFiatSet = notSupportedFiat.toSet();
+ final notSupportedCryptoSet = notSupportedCrypto.toSet();
+ final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiatSet.contains(fiat)).toList();
final supportedCrypto =
- CryptoCurrency.all.where((crypto) => !notSupportedCrypto.contains(crypto)).toList();
+ CryptoCurrency.all.where((crypto) => !notSupportedCryptoSet.contains(crypto)).toList();
return supportedFiat