From b5ff77f39423f5de344bffb1ebdf30bf0ef40506 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Fri, 24 Aug 2018 17:22:28 +0800 Subject: [PATCH] No longer add the default ticket token for new users --- AlphaWallet/Settings/Types/Config.swift | 33 ------------------- .../Coordinators/TokensCoordinator.swift | 9 ----- 2 files changed, 42 deletions(-) diff --git a/AlphaWallet/Settings/Types/Config.swift b/AlphaWallet/Settings/Types/Config.swift index 203235fee..04b3f7a22 100644 --- a/AlphaWallet/Settings/Types/Config.swift +++ b/AlphaWallet/Settings/Types/Config.swift @@ -140,39 +140,6 @@ struct Config { ///Debugging flag. Set to false to disable auto fetching prices, etc to cut down on network calls let isAutoFetchingDisabled = false - func createDefaultTicketToken() -> ERCToken? { - guard let contract = ticketContractAddress else { return nil } - guard let contractAddress = Address(string: contract) else { return nil } - let xmlHandler = XMLHandler(contract: contract) - let lang = xmlHandler.getLang() - let name = xmlHandler.getName(lang: lang) - //TODO get symbol from RPC node, but this doesn't provide much benefit as it is a hardcoded - //placeholder anyway - //GetSymbolCoordinator(web3: Web3Swift()).getSymbol(for: contractAddress) { result in } - switch server { - case .main: - return ERCToken( - contract: contractAddress, - name: Constants.event + " " + name, - symbol: "SHANKAI", - decimals: 0, - type: .erc875, - balance: [] - ) - case .ropsten: - return ERCToken( - contract: contractAddress, - name: name, - symbol: "TEST", - decimals: 0, - type: .erc875, - balance: [] - ) - case .kovan, .rinkeby, .poa, .sokol, .classic, .callisto, .custom: - return nil - } - } - func createDefaultTicketToken(forContract contract: String) -> ERCToken? { guard let contractAddress = Address(string: contract) else { return nil } let xmlHandler = XMLHandler(contract: contract) diff --git a/AlphaWallet/Tokens/Coordinators/TokensCoordinator.swift b/AlphaWallet/Tokens/Coordinators/TokensCoordinator.swift index b34249aca..e2e1dae67 100644 --- a/AlphaWallet/Tokens/Coordinators/TokensCoordinator.swift +++ b/AlphaWallet/Tokens/Coordinators/TokensCoordinator.swift @@ -62,7 +62,6 @@ class TokensCoordinator: Coordinator { } func start() { - addFIFAToken() autoDetectTokens() showTokens() refreshUponAssetDefinitionChanges() @@ -192,14 +191,6 @@ class TokensCoordinator: Coordinator { // navigationController.pushViewController(controller, animated: true) } - //FIFA add the FIFA token with a hardcoded address for appropriate network if not already present - private func addFIFAToken() { - if let token = session.config.createDefaultTicketToken(), !storage.enabledObject.contains { $0.address.eip55String == token.contract.eip55String } { - storage.addCustom(token: token) - } - tokensViewController.fetch() - } - /// Failure to obtain contract data may be due to no-connectivity. So we should check .failed(networkReachable: Bool) private func fetchContractData(for address: String, completion: @escaping (ContractData) -> Void) { var completedName: String?