Skip to content

Commit

Permalink
Merge pull request #563 from dashpay/release/7.0.1
Browse files Browse the repository at this point in the history
chore: Release 7.0.1
  • Loading branch information
pankcuf authored Jul 8, 2023
2 parents 55983c3 + 4176e4d commit 880eb43
Show file tree
Hide file tree
Showing 145 changed files with 3,042 additions and 4,099 deletions.
2 changes: 1 addition & 1 deletion DashSyncCurrentCommit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bfa1376ac66ddcf02a3de83d3507732a6a1c50a5
3bfe78b0722d5a0ca895c0bb24600ccd343d124e
296 changes: 143 additions & 153 deletions DashWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Icons & images.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Icons & [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Icons & [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
{
"filename" : "logo.uphold.png",
"idiom" : "universal",
"filename" : "uphold_logo.png",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions DashWallet/Sources/Application/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ final class App {
func cleanUp() {
TxUserInfoDAOImpl.shared.deleteAll()
AddressUserInfoDAOImpl.shared.deleteAll()
Coinbase.shared.reset()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class SyncingActivityMonitor: NSObject, NetworkReachabilityHandling {
DWGlobalOptions.sharedInstance().isResyncingWallet = false
}

guard oldValue != state else {
return
}

NotificationCenter.default.post(name: .syncStateChangedNotification, object: nil,
userInfo: [
kSyncStateChangedFromStateKey: oldValue,
Expand Down Expand Up @@ -151,6 +155,16 @@ class SyncingActivityMonitor: NSObject, NetworkReachabilityHandling {
startSyncingActivity()
}

@objc
func peerManagerConnectedPeersDidChangeNotification(notification: Notification) {
let isConnected = DWEnvironment.sharedInstance().currentChainManager.peerManager.connected

if isConnected {
NotificationCenter.default.removeObserver(self, name: .peerManagerConnectedPeersDidChange, object: nil)
startSyncingIfNeeded()
}
}

deinit {
NotificationCenter.default.removeObserver(self)
NotificationCenter.default.removeObserver(reachabilityObserver!)
Expand All @@ -164,6 +178,9 @@ class SyncingActivityMonitor: NSObject, NetworkReachabilityHandling {
extension SyncingActivityMonitor {
private func startSyncingIfNeeded() {
guard DWEnvironment.sharedInstance().currentChainManager.peerManager.connected else {
NotificationCenter.default.addObserver(self, selector: #selector(peerManagerConnectedPeersDidChangeNotification(notification:)),
name: .peerManagerConnectedPeersDidChange, object: nil)

return
}

Expand All @@ -173,7 +190,7 @@ extension SyncingActivityMonitor {
private func startSyncingActivity() {
guard !isSyncing else { return }

progress = 0
progress = chainSyncProgress
lastPeakDate = nil

NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(syncLoop), object: nil)
Expand Down Expand Up @@ -224,9 +241,6 @@ extension SyncingActivityMonitor {
perform(#selector(syncLoop), with: nil, afterDelay: kSyncLoopInterval)
}
else {
self.progress = 1.0
state = .syncDone

stopSyncingActivity(failed: false)
}
}
Expand Down Expand Up @@ -300,4 +314,7 @@ extension Notification.Name {
static let chainManagerSyncFailed: Notification.Name = .init(rawValue: "DSChainManagerSyncFailedNotification")
static let chainManagerChainSyncBlocksDidChange: Notification
.Name = .init(rawValue: "DSChainChainSyncBlocksDidChangeNotification")
static let peerManagerConnectedPeersDidChange: Notification
.Name = .init(rawValue: "DSPeerManagerConnectedPeersDidChangeNotification")

}
43 changes: 43 additions & 0 deletions DashWallet/Sources/Categories/UIApplication+DashWallet.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// Created by PT
// Copyright © 2023 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Darwin
import MachO.dyld

@objc
extension UIApplication {
@objc
static var isJailbroken: Bool {
var s = stat()
let jailbroken = stat("/bin/sh", &s) == 0 // if we can see /bin/sh, the app isn't sandboxed

// some anti-jailbreak detection tools re-sandbox apps, so do a secondary check for any MobileSubstrate dyld images
let count = _dyld_image_count()
for i in 0..<count {
if let name = String(validatingUTF8: _dyld_get_image_name(i)), name.contains("MobileSubstrate") {
return true
}
}

#if targetEnvironment(simulator)
return false
#else
return jailbroken
#endif
}

}
4 changes: 3 additions & 1 deletion DashWallet/Sources/Categories/UIDevice+Compatibility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ extension UIDevice {
static var isIphone6: Bool { isIphone && screenMaxLength <= 667.0 }
static var isIphone6Plus: Bool { isIphone && screenMaxLength <= 736.0 }

static var hasHomeIndicator: Bool { (UIApplication.shared.delegate?.window??.safeAreaInsets.bottom ?? 0) > 0 }
static var hasHomeIndicator: Bool {
(UIApplication.shared.delegate?.window??.safeAreaInsets.bottom ?? 0) > 0
}
}


Expand Down
4 changes: 4 additions & 0 deletions DashWallet/Sources/Categories/UITableView+DashWallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ extension UITableView {
dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as! T
}

func registerNibForHeaderFooterView<T: UITableViewHeaderFooterView>(for type: T.Type) {
register(UINib(nibName: T.reuseIdentifier, bundle: nil), forHeaderFooterViewReuseIdentifier: T.reuseIdentifier)
}

func registerClassforHeaderFooterView<T: UITableViewHeaderFooterView>(for type: T.Type) {
register(T.self, forHeaderFooterViewReuseIdentifier: T.reuseIdentifier)
}
Expand Down
15 changes: 13 additions & 2 deletions DashWallet/Sources/Models/Coinbase/Coinbase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class CoinbaseObjcWrapper: NSObject {
static func start() {
wrapped.initialize()
}

@objc
static func reset() {
wrapped.reset()
}
}

// MARK: - Coinbase
Expand All @@ -59,11 +64,17 @@ class Coinbase {
auth = CBAuth()
accountService = AccountService(authInterop: auth)
paymentMethodsService = PaymentMethods(authInterop: auth)
currencyExchanger.startExchangeRateFetching()

currencyExchanger.startExchangeRateFetching()
prefetchData()
}

func reset() {
Task {
try await signOut()
}
}

private func prefetchData() {
Task {
try await accountService.refreshAccount(kDashAccount)
Expand Down Expand Up @@ -135,7 +146,7 @@ extension Coinbase {
amount: UInt64) async throws -> CoinbaseTransaction {
do {
let tx = try await accountService.send(from: kDashAccount, amount: amount, verificationCode: verificationCode)

if let address = tx.to?.address {
Taxes.shared.mark(address: address, with: .transferIn)
}
Expand Down
6 changes: 3 additions & 3 deletions DashWallet/Sources/Models/CrowdNode/CrowdNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public final class CrowdNode {
let topUpTx = try await sendCoinsService.sendCoins(address: accountAddress,
amount: amount)
let filter = SpendableTransaction(transactionManager: transactionManager, txHashData: topUpTx.txHashData)

if filter.matches(tx: topUpTx) {
return topUpTx
} else {
Expand Down Expand Up @@ -276,11 +276,11 @@ extension CrowdNode {
DSLogger.log("found signUp CrowdNode request, account: \(address)")
signUpState = SignUpState.signingUp
}

private func validatePrefs() {
if let accountAddress = prefs.accountAddress {
let wallet = DWEnvironment.sharedInstance().currentWallet

if !wallet.containsAddress(accountAddress) {
DSLogger.log("Found alien address in CrowdNode prefs")
reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public final class SpendableTransaction: TransactionFilter {

func matches(tx: DSTransaction) -> Bool {
let hashMatch = tx.txHashData == txHashData

if hashMatch {
let relayCount = transactionManager.relayCount(forTransaction: tx.txHash)
DSLogger.log("CrowdNode: SpendableTransaction matched hash \(tx.txHashHexString); relayCount: \(relayCount)")

return relayCount > 0
}

return false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ extension ExplorePointOfUse {
return Int64.max
}
}

var emptyLogoImageName: String {
switch category {
case .merchant(_), .unknown:
return "image.explore.dash.wts.item.logo.empty"
case .atm:
return "image.explore.dash.atm.item.logo.empty"
}
}
}

// MARK: - ExplorePointOfUse.Atm
Expand Down Expand Up @@ -189,17 +198,17 @@ extension ExplorePointOfUse: RowDecodable {
let longitude = row[ExplorePointOfUse.longitude]
var website: String?

if var value = row[ExplorePointOfUse.website], !value.isEmpty {
if let value = row[ExplorePointOfUse.website], !value.isEmpty {
if !value.hasPrefix("http") {
website = "https://" + value
} else {
website = value
}
}

let phone: String? = row[ExplorePointOfUse.phone]?.digits
let logoLocation = row[ExplorePointOfUse.logoLocation]
let coverImage: String? = row[ExplorePointOfUse.coverImage]
let phone: String? = try? row.get(ExplorePointOfUse.phone)?.digits
let logoLocation: String? = try? row.get(ExplorePointOfUse.logoLocation)
let coverImage: String? = try? row.get(ExplorePointOfUse.coverImage)
let source: String? = row[ExplorePointOfUse.source]

let category: Category
Expand Down
2 changes: 1 addition & 1 deletion DashWallet/Sources/Models/Uphold/DWUpholdAPIProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ - (DWUpholdCancellationToken)upholdAuthorizedRequest:(HTTPRequest *)httpRequest

#pragma mark - API Provider

static NSSet<NSString *> *FiatCurrencyCodes() {
static NSSet<NSString *> *FiatCurrencyCodes(void) {
return [NSSet setWithObjects:
@"ARS", @"AUD", @"BRL", @"CAD", @"DKK", @"AED", @"EUR", @"HKD", @"INR", @"ILS", @"KES",
@"MXN", @"NZD", @"NOK", @"PHP", @"PLN", @"GBP", @"SGD", @"SEK", @"CHF", @"USD", @"JPY", @"CNY", nil];
Expand Down
2 changes: 1 addition & 1 deletion DashWallet/Sources/UI/Assembly/UIAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extension UINib {
guard let view = UINib(nibName: name.reuseIdentifier, bundle: nil).instantiate(withOwner: nil).first else {
fatalError("Expect view")
}

return view as! T
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class OrderPreviewViewController: BaseViewController, NetworkReachabilityHandlin
Cryptocurrency markets are volatile, and this allows us to temporarily lock in a price for trade execution.
""", comment: "Coinbase/Buy Dash/Fee Info")
vc.actionButtonText = NSLocalizedString("Learn More...", comment: "Coinbase")

let nvc = BaseNavigationController(rootViewController: vc)
present(nvc, animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ extension Service {
var entryIcon: String {
switch self {
case .coinbase: return "service.coinbase.square"
case .uphold: return "service.uphold.square"
case .uphold: return "uphold_logo"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class TransferAmountViewController: CoinbaseAmountViewController, Converte

override func actionButtonAction(sender: UIView) {
showActivityIndicator()

if transferModel.direction == .toCoinbase {
checkLeftoverBalance { [weak self] canContinue in
guard canContinue, let wSelf = self else { self?.hideActivityIndicator(); return }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,10 @@ final class SourceView: UIView {
addSubview(stackView)

imageView = UIImageView()
imageView.contentMode = .scaleAspectFit
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.layer.cornerRadius = 17
imageView.backgroundColor = .dw_secondaryBackground()
imageView.backgroundColor = .clear
stackView.addArrangedSubview(imageView)

let labelStackView = UIStackView()
Expand Down
2 changes: 1 addition & 1 deletion DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ final class CrowdNodeModel {
onlineAccountState = crowdNode.onlineAccountState
observeState()
observeBalances()

crowdNode.restoreState()
getAccountAddress()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ extension GettingStartedViewController {
}
}

// MARK: DWSecureWalletDelegate
// MARK: BackupInfoViewControllerDelegate

extension GettingStartedViewController: BackupInfoViewControllerDelegate {
private func backupPassphrase() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// limitations under the License.
//

#import "DWSyncProtocol.h"
#import "dashwallet-Swift.h"
#import <UIKit/UIKit.h>

Expand Down
Loading

0 comments on commit 880eb43

Please sign in to comment.