Merge pull request #3254 from vladyslav-iosdev/#3251

Remove TaiChi support #3251
pull/3258/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit c47c4405a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      AlphaWallet/Analytics/Models/AnalyticsTypes.swift
  2. 21
      AlphaWallet/Assets.xcassets/iconsSettingsTaiChi.imageset/Contents.json
  3. 8
      AlphaWallet/Assets.xcassets/iconsSettingsTaiChi.imageset/icons-settings-taichi.svg
  4. 1
      AlphaWallet/Localization/en.lproj/Localizable.strings
  5. 1
      AlphaWallet/Localization/es.lproj/Localizable.strings
  6. 1
      AlphaWallet/Localization/ja.lproj/Localizable.strings
  7. 1
      AlphaWallet/Localization/ko.lproj/Localizable.strings
  8. 1
      AlphaWallet/Localization/zh-Hans.lproj/Localizable.strings
  9. 20
      AlphaWallet/Settings/Types/Config.swift
  10. 1
      AlphaWallet/Settings/Types/Constants+Credentials.swift
  11. 31
      AlphaWallet/Settings/ViewControllers/AdvancedSettingsViewController.swift
  12. 9
      AlphaWallet/Settings/ViewModels/AdvancedSettingsViewModel.swift
  13. 17
      AlphaWallet/Transfer/Coordinators/SendTransactionCoordinator.swift
  14. 3
      AlphaWallet/Transfer/Coordinators/TransactionConfirmationCoordinator.swift

@ -72,7 +72,6 @@ enum Analytics {
case transactionType
case name
case messageType
case isTaiChiEnabled
case type
case isAllFunds
case addCustomChainType

@ -1,21 +0,0 @@
{
"images" : [
{
"filename" : "icons-settings-taichi.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -1,8 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
<g fill="none" fill-rule="evenodd">
<g>
<path fill="#2F2F2F" d="M20 40C8.954 40 0 31.046 0 20S8.954 0 20 0s20 8.954 20 20-8.954 20-20 20z"/>
<path fill="#FEFEFE" d="M20 20c-4.97 0-9 4.03-9 9 0 4.81 3.78 8.75 8.54 8.99C9.81 37.75 2 29.79 2 20S9.81 2.25 19.54 2.01c.15-.01.3-.01.46-.01.16 0 .31 0 .46.01C25.22 2.25 29 6.19 29 11c0 4.97-4.03 9-9 9z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 498 B

@ -89,7 +89,6 @@
"settings.backupWallet.button.title" = "Back up this Wallet";
"settings.showSeedPhrase.button.title" = "Show Seed Phrase";
"settings.walletConnect.button.title" = "WalletConnect";
"settings.useTaichiNetwork.button.title" = "Use TaiChi for Ethereum";
"settings.language.useSystem.title" = "Use System Setting";
"settings.version.label.title" = "Version";
"settings.tokenScriptStandard.title" = "TokenScript Compatibility";

@ -89,7 +89,6 @@
"settings.backupWallet.button.title" = "Hacer una copia de seguridad de este monedero";
"settings.showSeedPhrase.button.title" = "Show Seed Phrase";
"settings.walletConnect.button.title" = "WalletConnect";
"settings.useTaichiNetwork.button.title" = "Use TaiChi for Ethereum";
"settings.language.useSystem.title" = "Usar la configuración del sistema";
"settings.version.label.title" = "Versión";
"settings.tokenScriptStandard.title" = "Compatibilidad de TokenScript";

@ -89,7 +89,6 @@
"settings.backupWallet.button.title" = "Back up this Wallet";
"settings.showSeedPhrase.button.title" = "Show Seed Phrase";
"settings.walletConnect.button.title" = "WalletConnect";
"settings.useTaichiNetwork.button.title" = "Use TaiChi for Ethereum";
"settings.language.useSystem.title" = "システム設定を使用";
"settings.version.label.title" = "バージョン";
"settings.tokenScriptStandard.title" = "TokenScript Compatibility";

@ -89,7 +89,6 @@
"settings.backupWallet.button.title" = "Back up this Wallet";
"settings.showSeedPhrase.button.title" = "Show Seed Phrase";
"settings.walletConnect.button.title" = "WalletConnect";
"settings.useTaichiNetwork.button.title" = "Use TaiChi for Ethereum";
"settings.language.useSystem.title" = "시스템 설정 사용";
"settings.version.label.title" = "버전";
"settings.tokenScriptStandard.title" = "TokenScript Compatibility";

@ -89,7 +89,6 @@
"settings.backupWallet.button.title" = "备份此钱包";
"settings.showSeedPhrase.button.title" = "Show Seed Phrase";
"settings.walletConnect.button.title" = "WalletConnect";
"settings.useTaichiNetwork.button.title" = "Use TaiChi for Ethereum";
"settings.language.useSystem.title" = "使用系统设置";
"settings.version.label.title" = "版本";
"settings.tokenScriptStandard.title" = "TokenScript 兼容性";

@ -153,23 +153,12 @@ struct Config {
static let lastFetchedAutoDetectedTransactedTokenErc721BlockNumber = "lastFetchedAutoDetectedTransactedTokenErc721BlockNumber"
static let lastFetchedAutoDetectedTransactedTokenNonErc20BlockNumber = "lastFetchedAutoDetectedTransactedTokenNonErc20BlockNumber"
static let walletNames = "walletNames"
static let useTaiChiNetwork = "useTaiChiNetworkKey"
static let customRpcServers = "customRpcServers"
static let homePageURL = "homePageURL"
}
let defaults: UserDefaults
var useTaiChiNetwork: Bool {
get {
defaults.bool(forKey: Keys.useTaiChiNetwork)
}
set {
defaults.set(newValue, forKey: Keys.useTaiChiNetwork)
}
}
var enabledServers: [RPCServer] {
get {
if let chainIds = defaults.array(forKey: Keys.enabledServers) as? [Int] {
@ -246,15 +235,6 @@ struct Config {
let honeySwapTokens = URL(string: "https://tokens.honeyswap.org/")!
let rampAssets = URL(string: "https://api-instant.ramp.network")!
var taichiPrivateRpcUrl: URL? {
let key = Constants.Credentials.taiChiRPCKey
if key.isEmpty {
return nil
} else {
return URL(string: "http://api.taichi.network:10000/rpc/\(key)?txroute=private")!
}
}
func anyEnabledServer() -> RPCServer {
let servers = enabledServers
if servers.contains(.main) {

@ -9,7 +9,6 @@ extension Constants {
static let binanceSmartChainExplorerApiKey: String? = nil
static let analyticsKey = ""
static let paperTrail = (host: "", port: UInt(0))
static let taiChiRPCKey = ""
static let mailChimpListSpecificKey = ""
static let openseaKey = "11ba1b4f0c4246aeb07b1f8e5a20525f"
static let rampApiKey = "j5wr7oqktym7z69yyf84bb8a6cqb7qfu5ynmeyvn"

@ -73,33 +73,10 @@ extension AdvancedSettingsViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let row = viewModel.rows[indexPath.row]
switch row {
case .analytics, .changeCurrency, .changeLanguage, .clearBrowserCache, .console, .tokenScript:
let cell: SettingTableViewCell = tableView.dequeueReusableCell(for: indexPath)
cell.configure(viewModel: .init(titleText: row.title, subTitleText: nil, icon: row.icon))
return cell
case .useTaiChiNetwork:
let cell: SwitchTableViewCell = tableView.dequeueReusableCell(for: indexPath)
cell.configure(viewModel: .init(titleText: row.title, icon: row.icon, value: config.useTaiChiNetwork))
cell.delegate = self
return cell
}
}
}
extension AdvancedSettingsViewController: SwitchTableViewCellDelegate {
let cell: SettingTableViewCell = tableView.dequeueReusableCell(for: indexPath)
cell.configure(viewModel: .init(titleText: row.title, subTitleText: nil, icon: row.icon))
func cell(_ cell: SwitchTableViewCell, switchStateChanged isOn: Bool) {
guard let indexPath = cell.indexPath else { return }
switch viewModel.rows[indexPath.row] {
case .analytics, .changeCurrency, .changeLanguage, .clearBrowserCache, .console, .tokenScript:
break
case .useTaiChiNetwork:
config.useTaiChiNetwork = isOn
}
return cell
}
}
@ -139,8 +116,6 @@ extension AdvancedSettingsViewController: UITableViewDelegate {
delegate?.advancedSettingsViewControllerChangeCurrencySelected(in: self)
case .analytics:
delegate?.advancedSettingsViewControllerAnalyticsSelected(in: self)
case .useTaiChiNetwork:
break
}
}
}

@ -11,9 +11,9 @@ import UIKit
struct AdvancedSettingsViewModel {
var rows: [AdvancedSettingsRow] = {
if Features.isLanguageSwitcherDisabled {
return [.console, .clearBrowserCache, .tokenScript, .useTaiChiNetwork]
return [.console, .clearBrowserCache, .tokenScript]
} else {
return [.console, .clearBrowserCache, .tokenScript, .changeLanguage, .useTaiChiNetwork]
return [.console, .clearBrowserCache, .tokenScript, .changeLanguage]
}
}()
@ -29,7 +29,6 @@ enum AdvancedSettingsRow: CaseIterable {
case changeLanguage
case changeCurrency
case analytics
case useTaiChiNetwork
var title: String {
switch self {
@ -45,8 +44,6 @@ enum AdvancedSettingsRow: CaseIterable {
return R.string.localizable.settingsChangeCurrencyTitle()
case .analytics:
return R.string.localizable.settingsAnalitycsTitle()
case .useTaiChiNetwork:
return R.string.localizable.settingsUseTaichiNetworkButtonTitle()
}
}
@ -64,8 +61,6 @@ enum AdvancedSettingsRow: CaseIterable {
return R.image.settings_currency()!
case .analytics:
return R.image.settings_analytics()!
case .useTaiChiNetwork:
return R.image.iconsSettingsTaiChi()!
}
}
}

@ -96,22 +96,7 @@ class SendTransactionCoordinator {
}
private var rpcURL: URL {
session.server.rpcURLReplaceMainWithTaichiIfNeeded(config: config)
}
}
fileprivate extension RPCServer {
func rpcURLReplaceMainWithTaichiIfNeeded(config: Config) -> URL {
switch self {
case .main where config.useTaiChiNetwork:
if let url = config.taichiPrivateRpcUrl {
return url
} else {
return rpcURL
}
case .xDai, .kovan, .ropsten, .rinkeby, .poa, .sokol, .classic, .callisto, .goerli, .artis_sigma1, .artis_tau1, .binance_smart_chain, .binance_smart_chain_testnet, .custom, .heco, .heco_testnet, .main, .fantom, .fantom_testnet, .avalanche, .avalanche_testnet, .polygon, .mumbai_testnet, .optimistic, .optimisticKovan, .cronosTestnet:
return self.rpcURL
}
session.server.rpcURL
}
}

@ -326,8 +326,7 @@ extension TransactionConfirmationCoordinator {
var analyticsProperties: [String: AnalyticsEventPropertyValue] = [
Analytics.Properties.speedType.rawValue: speedType.rawValue,
Analytics.Properties.chain.rawValue: server.chainID,
Analytics.Properties.transactionType.rawValue: transactionType.rawValue,
Analytics.Properties.isTaiChiEnabled.rawValue: configurator.session.config.useTaiChiNetwork,
Analytics.Properties.transactionType.rawValue: transactionType.rawValue
]
switch configuration {
case .sendFungiblesTransaction(_, _, _, amount: let amount, _):

Loading…
Cancel
Save