Skip to content

Commit e881f77

Browse files
committed
Code refactoring
1 parent 95bdeae commit e881f77

14 files changed

+34
-142
lines changed

Adamant.xcodeproj/project.pbxproj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,7 +2877,7 @@
28772877
CODE_SIGN_ENTITLEMENTS = MessageNotificationContentExtension/Debug.entitlements;
28782878
CODE_SIGN_IDENTITY = "iPhone Developer";
28792879
CODE_SIGN_STYLE = Manual;
2880-
CURRENT_PROJECT_VERSION = 168;
2880+
CURRENT_PROJECT_VERSION = 169;
28812881
DEVELOPMENT_TEAM = J2L77FMN46;
28822882
INFOPLIST_FILE = MessageNotificationContentExtension/Info.plist;
28832883
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -2886,7 +2886,7 @@
28862886
"@executable_path/Frameworks",
28872887
"@executable_path/../../Frameworks",
28882888
);
2889-
MARKETING_VERSION = 2.1.6;
2889+
MARKETING_VERSION = 2.1.7;
28902890
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
28912891
MTL_FAST_MATH = YES;
28922892
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev.MessageNotificationContentExtension";
@@ -2906,7 +2906,7 @@
29062906
CODE_SIGN_IDENTITY = "Apple Development";
29072907
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
29082908
CODE_SIGN_STYLE = Manual;
2909-
CURRENT_PROJECT_VERSION = 168;
2909+
CURRENT_PROJECT_VERSION = 169;
29102910
DEVELOPMENT_TEAM = J2L77FMN46;
29112911
INFOPLIST_FILE = MessageNotificationContentExtension/Info.plist;
29122912
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -2915,7 +2915,7 @@
29152915
"@executable_path/Frameworks",
29162916
"@executable_path/../../Frameworks",
29172917
);
2918-
MARKETING_VERSION = 2.1.6;
2918+
MARKETING_VERSION = 2.1.7;
29192919
MTL_FAST_MATH = YES;
29202920
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger.MessageNotificationContentExtension";
29212921
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3053,7 +3053,7 @@
30533053
CODE_SIGN_ENTITLEMENTS = Adamant/Debug.entitlements;
30543054
CODE_SIGN_IDENTITY = "iPhone Developer";
30553055
CODE_SIGN_STYLE = Manual;
3056-
CURRENT_PROJECT_VERSION = 168;
3056+
CURRENT_PROJECT_VERSION = 169;
30573057
DEVELOPMENT_TEAM = J2L77FMN46;
30583058
DISPLAY_NAME = ADM.Dev;
30593059
EXCLUDED_SOURCE_FILE_NAMES = "";
@@ -3063,7 +3063,7 @@
30633063
"$(inherited)",
30643064
"@executable_path/Frameworks",
30653065
);
3066-
MARKETING_VERSION = 2.1.6;
3066+
MARKETING_VERSION = 2.1.7;
30673067
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev";
30683068
PRODUCT_NAME = "$(TARGET_NAME)";
30693069
PROVISIONING_PROFILE = "e4233bbf-3705-44fe-95b0-e77475672c60";
@@ -3082,7 +3082,7 @@
30823082
CODE_SIGN_IDENTITY = "Apple Development";
30833083
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
30843084
CODE_SIGN_STYLE = Manual;
3085-
CURRENT_PROJECT_VERSION = 168;
3085+
CURRENT_PROJECT_VERSION = 169;
30863086
DEVELOPMENT_TEAM = J2L77FMN46;
30873087
DISPLAY_NAME = Adamant;
30883088
EXCLUDED_SOURCE_FILE_NAMES = Debug.xcassets;
@@ -3092,7 +3092,7 @@
30923092
"$(inherited)",
30933093
"@executable_path/Frameworks",
30943094
);
3095-
MARKETING_VERSION = 2.1.6;
3095+
MARKETING_VERSION = 2.1.7;
30963096
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger";
30973097
PRODUCT_NAME = "$(TARGET_NAME)";
30983098
PROVISIONING_PROFILE = "bedd1b75-2f23-4a85-a0b2-14c424fcff42";
@@ -3110,7 +3110,7 @@
31103110
CODE_SIGN_ENTITLEMENTS = TransferNotificationContentExtension/Debug.entitlements;
31113111
CODE_SIGN_IDENTITY = "iPhone Developer";
31123112
CODE_SIGN_STYLE = Manual;
3113-
CURRENT_PROJECT_VERSION = 168;
3113+
CURRENT_PROJECT_VERSION = 169;
31143114
DEVELOPMENT_TEAM = J2L77FMN46;
31153115
INFOPLIST_FILE = TransferNotificationContentExtension/Info.plist;
31163116
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -3119,7 +3119,7 @@
31193119
"@executable_path/Frameworks",
31203120
"@executable_path/../../Frameworks",
31213121
);
3122-
MARKETING_VERSION = 2.1.6;
3122+
MARKETING_VERSION = 2.1.7;
31233123
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
31243124
MTL_FAST_MATH = YES;
31253125
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev.TransferNotificationContentExtension";
@@ -3139,7 +3139,7 @@
31393139
CODE_SIGN_IDENTITY = "Apple Development";
31403140
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
31413141
CODE_SIGN_STYLE = Manual;
3142-
CURRENT_PROJECT_VERSION = 168;
3142+
CURRENT_PROJECT_VERSION = 169;
31433143
DEVELOPMENT_TEAM = J2L77FMN46;
31443144
INFOPLIST_FILE = TransferNotificationContentExtension/Info.plist;
31453145
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -3148,7 +3148,7 @@
31483148
"@executable_path/Frameworks",
31493149
"@executable_path/../../Frameworks",
31503150
);
3151-
MARKETING_VERSION = 2.1.6;
3151+
MARKETING_VERSION = 2.1.7;
31523152
MTL_FAST_MATH = YES;
31533153
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger.TransferNotificationContentExtension";
31543154
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3168,7 +3168,7 @@
31683168
CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/Debug.entitlements;
31693169
CODE_SIGN_IDENTITY = "iPhone Developer";
31703170
CODE_SIGN_STYLE = Manual;
3171-
CURRENT_PROJECT_VERSION = 168;
3171+
CURRENT_PROJECT_VERSION = 169;
31723172
DEVELOPMENT_TEAM = J2L77FMN46;
31733173
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
31743174
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -3177,7 +3177,7 @@
31773177
"@executable_path/Frameworks",
31783178
"@executable_path/../../Frameworks",
31793179
);
3180-
MARKETING_VERSION = 2.1.6;
3180+
MARKETING_VERSION = 2.1.7;
31813181
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
31823182
MTL_FAST_MATH = YES;
31833183
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev.NotificationServiceExtension";
@@ -3197,7 +3197,7 @@
31973197
CODE_SIGN_IDENTITY = "Apple Development";
31983198
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
31993199
CODE_SIGN_STYLE = Manual;
3200-
CURRENT_PROJECT_VERSION = 168;
3200+
CURRENT_PROJECT_VERSION = 169;
32013201
DEVELOPMENT_TEAM = J2L77FMN46;
32023202
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
32033203
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -3206,7 +3206,7 @@
32063206
"@executable_path/Frameworks",
32073207
"@executable_path/../../Frameworks",
32083208
);
3209-
MARKETING_VERSION = 2.1.6;
3209+
MARKETING_VERSION = 2.1.7;
32103210
MTL_FAST_MATH = YES;
32113211
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger.NotificationServiceExtension";
32123212
PRODUCT_NAME = "$(TARGET_NAME)";

Adamant/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleVersion</key>
2222
<string>$(CURRENT_PROJECT_VERSION)</string>
2323
<key>ITSAppUsesNonExemptEncryption</key>
24-
<false/>
24+
<true/>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>NSAppTransportSecurity</key>

Adamant/Utilities/AdamantUriTools.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ enum AdamantAddressParam {
4646

4747
class AdamantUriTools {
4848
static let AdamantProtocol = "adm"
49-
static let AdamantHost = "https://msg.adamant.im"
5049

5150
static func encode(request: AdamantUri) -> String {
5251
switch request {

Adamant/Wallets/Adamant/AdmTransferViewController.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -264,17 +264,4 @@ class AdmTransferViewController: TransferViewControllerBase {
264264
return String.adamantLocalized.wallets.sendAdm
265265
}
266266

267-
// MARK: - Tools
268-
269-
func shareValue(_ value: String, from: UIView) {
270-
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
271-
guard let tableView = self?.tableView else {
272-
return
273-
}
274-
275-
if let indexPath = tableView.indexPathForSelectedRow {
276-
tableView.deselectRow(at: indexPath, animated: true)
277-
}
278-
}
279-
}
280267
}

Adamant/Wallets/Dash/DashTransferViewController.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -253,18 +253,4 @@ class DashTransferViewController: TransferViewControllerBase {
253253
override func defaultSceneTitle() -> String? {
254254
return String.adamantLocalized.sendDash
255255
}
256-
257-
// MARK: - Tools
258-
259-
func shareValue(_ value: String, from: UIView) {
260-
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
261-
guard let tableView = self?.tableView else {
262-
return
263-
}
264-
265-
if let indexPath = tableView.indexPathForSelectedRow {
266-
tableView.deselectRow(at: indexPath, animated: true)
267-
}
268-
}
269-
}
270256
}

Adamant/Wallets/Doge/DogeTransferViewController.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,4 @@ class DogeTransferViewController: TransferViewControllerBase {
239239
override func defaultSceneTitle() -> String? {
240240
return String.adamantLocalized.sendDoge
241241
}
242-
243-
// MARK: - Tools
244-
245-
func shareValue(_ value: String, from: UIView) {
246-
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
247-
guard let tableView = self?.tableView else {
248-
return
249-
}
250-
251-
if let indexPath = tableView.indexPathForSelectedRow {
252-
tableView.deselectRow(at: indexPath, animated: true)
253-
}
254-
}
255-
}
256242
}

Adamant/Wallets/ERC20/ERC20TransferViewController.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,4 @@ class ERC20TransferViewController: TransferViewControllerBase {
259259
override func defaultSceneTitle() -> String? {
260260
return String.adamantLocalized.wallets.erc20.sendToken(service?.tokenSymbol ?? "ERC20")
261261
}
262-
263-
// MARK: - Tools
264-
265-
func shareValue(_ value: String, from: UIView) {
266-
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
267-
guard let tableView = self?.tableView else {
268-
return
269-
}
270-
271-
if let indexPath = tableView.indexPathForSelectedRow {
272-
tableView.deselectRow(at: indexPath, animated: true)
273-
}
274-
}
275-
}
276262
}

Adamant/Wallets/Ethereum/EthTransferViewController.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,4 @@ class EthTransferViewController: TransferViewControllerBase {
251251
override func defaultSceneTitle() -> String? {
252252
return String.adamantLocalized.wallets.sendEth
253253
}
254-
255-
// MARK: - Tools
256-
257-
func shareValue(_ value: String, from: UIView) {
258-
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
259-
guard let tableView = self?.tableView else {
260-
return
261-
}
262-
263-
if let indexPath = tableView.indexPathForSelectedRow {
264-
tableView.deselectRow(at: indexPath, animated: true)
265-
}
266-
}
267-
}
268254
}

Adamant/Wallets/Lisk/LskTransactionsViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ extension Transactions.TransactionModel: TransactionDetails {
172172
let conf = (confirmations - self.height) + 1
173173
if conf > 1 {
174174
return .success
175-
}else {
175+
} else {
176176
return .pending
177177
}
178178
}

Adamant/Wallets/Lisk/LskTransferViewController.swift

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class LskTransferViewController: TransferViewControllerBase {
108108
if error.message.contains("does not meet the minimum remaining balance requirement") {
109109
let localizedErrorMessage = NSLocalizedString("TransactionSend.Minimum.Balance", comment: "Transaction send: recipient minimum remaining balance requirement")
110110
vc.dialogService.showWarning(withMessage: localizedErrorMessage)
111-
}else {
111+
} else {
112112
vc.dialogService.showRichError(error: error)
113113
}
114114
}
@@ -240,19 +240,4 @@ class LskTransferViewController: TransferViewControllerBase {
240240
override func defaultSceneTitle() -> String? {
241241
return String.adamantLocalized.sendLsk
242242
}
243-
244-
245-
// MARK: - Tools
246-
247-
func shareValue(_ value: String, from: UIView) {
248-
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
249-
guard let tableView = self?.tableView else {
250-
return
251-
}
252-
253-
if let indexPath = tableView.indexPathForSelectedRow {
254-
tableView.deselectRow(at: indexPath, animated: true)
255-
}
256-
}
257-
}
258243
}

Adamant/Wallets/TransactionDetailsViewControllerBase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ class TransactionDetailsViewControllerBase: FormViewController {
572572
safari.preferredControlTintColor = UIColor.adamant.primary
573573
safari.modalPresentationStyle = .overFullScreen
574574
self?.present(safari, animated: true, completion: nil)
575-
}else {
575+
} else {
576576
UIApplication.shared.open(url, options: [:], completionHandler: nil)
577577
}
578578
}

Adamant/Wallets/TransferViewControllerBase.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,6 @@ class TransferViewControllerBase: FormViewController {
325325
$0.tag = Sections.recipient.tag
326326
}
327327

328-
// Name row
329-
// let nameRow = defaultRowFor(baseRow: BaseRows.name)
330-
// section.append(nameRow)
331-
332328
// Address row
333329
section.append(defaultRowFor(baseRow: BaseRows.address))
334330

@@ -543,7 +539,6 @@ class TransferViewControllerBase: FormViewController {
543539
self.present(alert, animated: true, completion: nil)
544540
}
545541
}
546-
//present(alert, animated: true, completion: nil)
547542
}
548543

549544

@@ -822,4 +817,18 @@ extension TransferViewControllerBase {
822817
}
823818
}
824819
}
820+
821+
// MARK: - Tools
822+
823+
func shareValue(_ value: String, from: UIView) {
824+
dialogService.presentShareAlertFor(string: value, types: [.copyToPasteboard, .share], excludedActivityTypes: nil, animated: true, from: from) { [weak self] in
825+
guard let tableView = self?.tableView else {
826+
return
827+
}
828+
829+
if let indexPath = tableView.indexPathForSelectedRow {
830+
tableView.deselectRow(at: indexPath, animated: true)
831+
}
832+
}
833+
}
825834
}

AdamantShared/Models/ERC20Token.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,5 @@ extension ERC20Token {
3131
contractAddress: "0xa4bdb11dc0a2bec88d24a3aa1e6bb17201112ebe",
3232
decimals: 6,
3333
naturalUnits: 6)
34-
// ERC20Token(symbol: "BZ",
35-
// name: "Bit-Z",
36-
// contractAddress: "0x4375e7ad8a01b8ec3ed041399f62d9cd120e0063",
37-
// decimals: 18,
38-
// naturalUnits: 18),
39-
// ERC20Token(symbol: "KCS",
40-
// name: "KuCoin Shares",
41-
// contractAddress: "0x039b5649a59967e3e936d7471f9c3700100ee1ab",
42-
// decimals: 6,
43-
// naturalUnits: 6),
44-
// ERC20Token(symbol: "RES",
45-
// name: "Resfinex Token",
46-
// contractAddress: "0x0a9f693fce6f00a51a8e0db4351b5a8078b4242e",
47-
// decimals: 5,
48-
// naturalUnits: 5)//, добавить токен
49-
// Test ERC20 Tokens in Ropsten testnet
50-
// ERC20Token(symbol: "BOKKY", name: "BOKKY", contractAddress: "0x583cbBb8a8443B38aBcC0c956beCe47340ea1367", decimals: 18, logo: #imageLiteral(resourceName: "wallet_kcs")),
51-
// ERC20Token(symbol: "WEENUS", name: "WEENUS", contractAddress: "0x101848D5C5bBca18E6b4431eEdF6B95E9ADF82FA", decimals: 18, logo: #imageLiteral(resourceName: "wallet_usds"))
5234
]
5335
}

LiskKit/Sources/Core/APIClient.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,7 @@ public struct APIClient {
115115

116116
/// Create a json data task
117117
private func dataTask<R>(_ request: URLRequest, completionHandler: @escaping (Response<R>) -> Void) -> URLSessionDataTask {
118-
119-
#if DEBUG
120-
if let url = request.url {
121-
print("url path=", url)
122-
}
123-
#endif
124118
let task = urlSession.dataTask(with: request) { data, _, _ in
125-
#if DEBUG
126-
if let data = data {
127-
let str = String(decoding: data, as: UTF8.self)
128-
print("response=", str)
129-
}
130-
#endif
131-
132-
133119
let response: Response<R> = self.processRequestCompletion(data)
134120
DispatchQueue.main.async { completionHandler(response) }
135121
}

0 commit comments

Comments
 (0)