Skip to content

Commit

Permalink
Merge pull request #576 from dashpay/release/7.0.2
Browse files Browse the repository at this point in the history
chore: Merge release 7.0.2 into master
  • Loading branch information
pankcuf authored Jul 25, 2023
2 parents 880eb43 + ffba691 commit 54d66c0
Show file tree
Hide file tree
Showing 317 changed files with 5,999 additions and 3,163 deletions.
2 changes: 1 addition & 1 deletion DashSyncCurrentCommit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3bfe78b0722d5a0ca895c0bb24600ccd343d124e
af75b12a4dd613335bbec63f7380c59bd257e41e
242 changes: 129 additions & 113 deletions DashWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
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
@@ -0,0 +1,56 @@
{
"images" : [
{
"filename" : "scan-qr.accessory.icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Button.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[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.
13 changes: 13 additions & 0 deletions DashWallet/Sources/Categories/String+DashWallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,19 @@ extension String {
}
}

@objc
extension NSString {
var wordsCount: UInt {
var count: UInt = 0

enumerateSubstrings(in: NSMakeRange(0, length), options: [.byWords]) { _, _, _, _ in
count += 1
}

return count
}
}

extension NSRange {
var isValid: Bool {
location != NSNotFound
Expand Down
181 changes: 0 additions & 181 deletions DashWallet/Sources/Categories/UIViewController+Payments.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ class CurrencyExchangerObjcWrapper: NSObject {
}
}

public typealias CurrencyExchangerObserver = String
public typealias CurrencyExchangerObserverHandler = (CurrencyExchanger) -> ()

// MARK: - CurrencyExchanger

public final class CurrencyExchanger {
Expand All @@ -120,6 +123,8 @@ public final class CurrencyExchanger {
private var pricesByCode: [String: RateObject]!
private var plainPricesByCode: [String: Decimal]!

private lazy var observers: [CurrencyExchangerObserver: CurrencyExchangerObserverHandler] = [:]

init(dataProvider: RatesProvider) {
self.dataProvider = dataProvider
configure(dataProvider: dataProvider)
Expand All @@ -139,6 +144,16 @@ public final class CurrencyExchanger {
return rate
}

public func addObserver(_ observer: @escaping CurrencyExchangerObserverHandler) -> CurrencyExchangerObserver {
let handle = UUID().uuidString
observers[handle] = observer
return handle
}

public func removeObserver(_ observer: CurrencyExchangerObserver) {
observers.removeValue(forKey: observer)
}

public func convertDash(amount: Decimal, to currency: String) throws -> Decimal {
if amount.isZero { return 0 }

Expand Down Expand Up @@ -225,6 +240,13 @@ extension CurrencyExchanger {
self.pricesByCode = pricesByCode
self.plainPricesByCode = plainPricesByCode
self.currencies = array
self.fireHandlers()
}
}

private func fireHandlers() {
for item in observers {
item.value(self)
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions DashWallet/Sources/Models/CrowdNode/CrowdNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ extension CrowdNode {

func calculateWithdrawalPermil(forAmount: UInt64) -> UInt64 {
let maxPermil = ApiCode.withdrawAll.rawValue

if balance == 0 {
return maxPermil
}

let permil = UInt64(round(Double(forAmount * maxPermil) / Double(balance)))
let requestPermil = min(permil, maxPermil)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private let timestampKey = "Data-Timestamp"
private let checksumKey = "Data-Checksum"

// TODO: Move it to plist and note in release process
let bundleExploreDatabaseSyncTime: TimeInterval = 1682958684916/1000
let bundleExploreDatabaseSyncTime: TimeInterval = 1689686772332/1000

// MARK: - ExploreDatabaseSyncManager

Expand Down
15 changes: 9 additions & 6 deletions DashWallet/Sources/UI/Coinbase/Base.lproj/Coinbase.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="dark"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
Expand Down Expand Up @@ -424,10 +423,10 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L9J-HU-WzI">
<rect key="frame" x="20" y="234.5" width="374" height="619.5"/>
<rect key="frame" x="20" y="234.5" width="374" height="627.5"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Li-Ki-nSF">
<rect key="frame" x="0.0" y="557.5" width="374" height="62"/>
<rect key="frame" x="0.0" y="565.5" width="374" height="62"/>
<constraints>
<constraint firstAttribute="height" constant="62" id="QeI-nd-ZrV"/>
</constraints>
Expand Down Expand Up @@ -537,7 +536,7 @@
<rect key="frame" x="0.0" y="0.0" width="140" height="40"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="portal.coinbase" translatesAutoresizingMaskIntoConstraints="NO" id="Ma7-eg-p1L">
<rect key="frame" x="0.0" y="2.6666666666666679" width="35" height="35"/>
<rect key="frame" x="0.0" y="2.5" width="35" height="35"/>
<constraints>
<constraint firstAttribute="width" constant="35" id="0JN-IQ-uon"/>
<constraint firstAttribute="height" constant="35" id="1ql-Ce-xQz"/>
Expand Down Expand Up @@ -1060,6 +1059,7 @@
<point key="canvasLocation" x="1986" y="-622"/>
</scene>
</scenes>
<color key="tintColor" name="DashBlueColor"/>
<resources>
<image name="chevron.right" catalog="system" width="97" height="128"/>
<image name="coinbase.info" width="330" height="300"/>
Expand All @@ -1076,6 +1076,9 @@
<namedColor name="ChevronColor">
<color red="0.85098039215686272" green="0.85098039215686272" blue="0.85098039215686272" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="DashBlueColor">
<color red="0.0" green="0.55294117647058827" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="RedColor">
<color red="0.81599998474121094" green="0.0080000003799796104" blue="0.10599999874830246" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
Expand Down
Loading

0 comments on commit 54d66c0

Please sign in to comment.