Skip to content

Commit

Permalink
Dead code (#843)
Browse files Browse the repository at this point in the history
- Removed unused code
- Removed unused assets
- Removed public access control from the code
- Marked some classes as final
  • Loading branch information
TruszczynskiA authored Feb 3, 2023
1 parent d00d2e3 commit 3ea3950
Show file tree
Hide file tree
Showing 67 changed files with 65 additions and 836 deletions.
24 changes: 0 additions & 24 deletions MobileWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions MobileWallet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ import AVFoundation
import GiphyUISDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

private let statusLoggerManager = StatusLoggerManager()
final class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

func application(
_ application: UIApplication,
Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 0 additions & 23 deletions MobileWallet/Assets.xcassets/Assets/bell7.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 0 additions & 3 deletions MobileWallet/Backup/Manager/BackupManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ final class BackupManager {
set { dropboxBackupService.presentingController = newValue }
}

var isAnyServiceOn: Bool { allServices.first { $0.isOn } != nil }
var isAnyServiceSynced: Bool { allServices.compactMap { $0.lastBackupTimestamp }.isEmpty == false }

@Published var password: String? = AppKeychainWrapper.backupPassword
@Published private(set) var syncState: BackupSyncState = .outOfSync

Expand Down
7 changes: 1 addition & 6 deletions MobileWallet/Common/AESEncryption.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@
import Foundation
import CommonCrypto

protocol Cryptable {
func encrypt(_ data: Data) throws -> Data
func decrypt(_ data: Data) throws -> Data
}

enum AESError: Error {
case generic(_ description: String)
case invalidKeySize
Expand Down Expand Up @@ -90,7 +85,7 @@ struct AESEncryption {
}
}

extension AESEncryption: Cryptable {
extension AESEncryption {
func encrypt(_ data: Data) throws -> Data {
let salt = try generateSalt()
let key = try createKey(password: keyString, salt: salt)
Expand Down
7 changes: 0 additions & 7 deletions MobileWallet/Common/Errors/WalletError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,8 @@ struct WalletError: CoreError {
}

static var notEnoughFunds: Self { WalletError(code: 101) }
static var databaseDataError: Self { WalletError(code: 114) }
static var fundsPending: Self { WalletError(code: 115) }
static var transactionNotFound: Self { WalletError(code: 204) }
static var contactNotFound: Self { WalletError(code: 401) }
static var invalidPassphraseEncryptionCypher: Self { WalletError(code: 420) }
static var valuesNotFound: Self { WalletError(code: 424) }
static var invalidPassphrase: Self { WalletError(code: 428) }
static var seedWordsInvalidData: Self { WalletError(code: 429) }
static var seedWordsVersionMismatch: Self { WalletError(code: 430) }

static var unknown: Self { WalletError(code: -1) }

Expand Down
7 changes: 0 additions & 7 deletions MobileWallet/Common/Extensions/Date.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,4 @@ extension Date {

return dateFormatter.string(from: self)
}

/*
Adjust a date by number of days
*/
func shiftDateBy(days: Int) -> Date {
return Calendar.current.date(byAdding: Calendar.Component.day, value: days, to: self)!
}
}
95 changes: 0 additions & 95 deletions MobileWallet/Common/Extensions/NSPointerArray+Extension.swift

This file was deleted.

10 changes: 0 additions & 10 deletions MobileWallet/Common/Extensions/String+Emoji.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,5 @@ extension Character {
}

extension String {
var isSingleEmoji: Bool { count == 1 && containsEmoji }

var containsEmoji: Bool { contains { $0.isEmoji } }

var containsOnlyEmoji: Bool { !isEmpty && !contains { !$0.isEmoji } }

var emojiString: String { emojis.map { String($0) }.reduce("", +) }

var emojis: [Character] { filter { $0.isEmoji } }

var emojiScalars: [UnicodeScalar] { filter { $0.isEmoji }.flatMap { $0.unicodeScalars } }
}
Loading

0 comments on commit 3ea3950

Please sign in to comment.