From f9186a8823cabbb95fee6fc1446a70640715f8d1 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 18 Sep 2023 16:55:15 +0800 Subject: [PATCH] Fix NFT auto token and balance detection for Sepolia --- .../Tokens/Logic/EtherscanCompatibleBlockchainExplorer.swift | 4 ++-- .../EtherscanSingleChainTransactionProvider.swift | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/AlphaWalletFoundation/AlphaWalletFoundation/Tokens/Logic/EtherscanCompatibleBlockchainExplorer.swift b/modules/AlphaWalletFoundation/AlphaWalletFoundation/Tokens/Logic/EtherscanCompatibleBlockchainExplorer.swift index fba2e4c18..74be5b937 100644 --- a/modules/AlphaWalletFoundation/AlphaWalletFoundation/Tokens/Logic/EtherscanCompatibleBlockchainExplorer.swift +++ b/modules/AlphaWalletFoundation/AlphaWalletFoundation/Tokens/Logic/EtherscanCompatibleBlockchainExplorer.swift @@ -589,9 +589,9 @@ extension EtherscanCompatibleBlockchainExplorer.functional { //TODO should move this to where the blockchain APIs are defined so we can update them in lock-step? static func serverSupportsFetchingNftTransactions(_ server: RPCServer) -> Bool { switch server { - case .main, .polygon, .binance_smart_chain, .binance_smart_chain_testnet, .optimistic, .cronosMainnet, .arbitrum, .arbitrumGoerli, .avalanche, .avalanche_testnet, .heco, .heco_testnet: + case .main, .polygon, .binance_smart_chain, .binance_smart_chain_testnet, .optimistic, .cronosMainnet, .arbitrum, .arbitrumGoerli, .avalanche, .avalanche_testnet, .heco, .heco_testnet, .sepolia: return true - case .goerli, .fantom, .fantom_testnet, .mumbai_testnet, .klaytnCypress, .klaytnBaobabTestnet, .ioTeX, .ioTeXTestnet, .okx, .sepolia, .classic, .xDai, .callisto, .cronosTestnet, .palm, .palmTestnet, .optimismGoerli: + case .goerli, .fantom, .fantom_testnet, .mumbai_testnet, .klaytnCypress, .klaytnBaobabTestnet, .ioTeX, .ioTeXTestnet, .okx, .classic, .xDai, .callisto, .cronosTestnet, .palm, .palmTestnet, .optimismGoerli: return false case .custom(let customRpc): switch customRpc.etherscanCompatibleType { diff --git a/modules/AlphaWalletFoundation/AlphaWalletFoundation/Transactions/EtherscanSingleChainTransactionProvider.swift b/modules/AlphaWalletFoundation/AlphaWalletFoundation/Transactions/EtherscanSingleChainTransactionProvider.swift index 039571817..a91e7ad64 100644 --- a/modules/AlphaWalletFoundation/AlphaWalletFoundation/Transactions/EtherscanSingleChainTransactionProvider.swift +++ b/modules/AlphaWalletFoundation/AlphaWalletFoundation/Transactions/EtherscanSingleChainTransactionProvider.swift @@ -318,6 +318,11 @@ extension EtherscanSingleChainTransactionProvider { } func fetchPublisher() -> AnyPublisher<[Transaction], PromiseError> { + //TODO can remove after a while, maybe? This is to fix previously marking it as not supported + if transferType == .erc721 && session.server == .sepolia { + stateProvider.state = .initial + } + guard stateProvider.state != .stopped else { return .fail(PromiseError(error: SchedulerError.cancelled)) }