Skip to content

Commit

Permalink
Merge pull request #551 from dashpay/release/7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tikhop authored May 21, 2023
2 parents 94bf1b8 + 983d3ec commit 55983c3
Show file tree
Hide file tree
Showing 21 changed files with 186 additions and 131 deletions.
2 changes: 1 addition & 1 deletion DashSyncCurrentCommit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
66aed38275fe8e5f8ee2e05cfa1414777952c94f
bfa1376ac66ddcf02a3de83d3507732a6a1c50a5
32 changes: 16 additions & 16 deletions DashWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7438,7 +7438,7 @@
INFOPLIST_KEY_CFBundleDisplayName = Dash;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
Expand Down Expand Up @@ -7496,7 +7496,7 @@
INFOPLIST_KEY_CFBundleDisplayName = Dash;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "DashWallet/dashwallet-Bridging-Header.h";
Expand Down Expand Up @@ -7581,7 +7581,7 @@
EXCLUDED_ARCHS = "";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -7603,7 +7603,7 @@
EXCLUDED_ARCHS = "";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -7624,7 +7624,7 @@
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = "WatchApp Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
Expand All @@ -7647,7 +7647,7 @@
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = "WatchApp Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
Expand Down Expand Up @@ -7675,7 +7675,7 @@
INFOPLIST_FILE = TodayExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -7700,7 +7700,7 @@
INFOPLIST_FILE = TodayExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -7817,7 +7817,7 @@
INFOPLIST_KEY_CFBundleDisplayName = Dash;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "DashWallet/dashwallet-Bridging-Header.h";
Expand Down Expand Up @@ -7845,7 +7845,7 @@
INFOPLIST_FILE = TodayExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -7897,7 +7897,7 @@
EXCLUDED_ARCHS = "";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -7918,7 +7918,7 @@
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = "WatchApp Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
Expand Down Expand Up @@ -8034,7 +8034,7 @@
INFOPLIST_KEY_CFBundleDisplayName = Dash;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "DashWallet/dashwallet-Bridging-Header.h";
Expand All @@ -8061,7 +8061,7 @@
INFOPLIST_FILE = TodayExtension/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -8112,7 +8112,7 @@
EXCLUDED_ARCHS = "";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = watchos;
Expand All @@ -8133,7 +8133,7 @@
EXCLUDED_ARCHS = "";
INFOPLIST_FILE = "WatchApp Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
MARKETING_VERSION = 6.3.3;
MARKETING_VERSION = 7.0.0;
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
PRODUCT_NAME = "${TARGET_NAME}";
SDKROOT = watchos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ class SyncingActivityMonitor: NSObject, NetworkReachabilityHandling {
case unknown
}

@objc
public var progress: Double = 0 {
didSet {
observers.forEach { $0.syncingActivityMonitorProgressDidChange(progress) }
}
}

@objc public var state: State = .unknown {
@objc
public var state: State = .unknown {
didSet {
guard state != oldValue else { return }

if state == .syncDone {
DWGlobalOptions.sharedInstance().isResyncingWallet = false
}
Expand Down
56 changes: 28 additions & 28 deletions DashWallet/Sources/Categories/DSChain+DashWallet.m
Original file line number Diff line number Diff line change
Expand Up @@ -235,78 +235,78 @@ - (uint64_t)calculateblockInflationWithHeight:(uint64_t)height nPrevBits:(uint32
}

- (uint64_t)increaseBlockHeight {
switch (self.chainType) {
case DSChainType_MainNet:
switch (self.chainType.tag) {
case ChainType_MainNet:
return 158000;
case DSChainType_TestNet:
case ChainType_TestNet:
return 4030;
case DSChainType_DevNet:
case ChainType_DevNet:
return 4030;
}
}

- (uint64_t)period {
switch (self.chainType) {
case DSChainType_MainNet:
switch (self.chainType.tag) {
case ChainType_MainNet:
return 576 * 30;
case DSChainType_TestNet:
case ChainType_TestNet:
return 10;
case DSChainType_DevNet:
case ChainType_DevNet:
return 10;
}
}

- (uint64_t)brrHeight {
switch (self.chainType) {
case DSChainType_MainNet:
switch (self.chainType.tag) {
case ChainType_MainNet:
return 1374912;
case DSChainType_TestNet:
case ChainType_TestNet:
return 387500;
case DSChainType_DevNet:
case ChainType_DevNet:
return 300;
}
}

- (uint64_t)superblockCycle {
switch (self.chainType) {
case DSChainType_MainNet:
switch (self.chainType.tag) {
case ChainType_MainNet:
return 16616;
case DSChainType_TestNet:
case ChainType_TestNet:
return 24;
case DSChainType_DevNet:
case ChainType_DevNet:
return 24;
}
}

- (uint64_t)superblockStartBlock {
switch (self.chainType) {
case DSChainType_MainNet:
switch (self.chainType.tag) {
case ChainType_MainNet:
return 614820;
case DSChainType_TestNet:
case ChainType_TestNet:
return 4200;
case DSChainType_DevNet:
case ChainType_DevNet:
return 24;
}
}

- (uint64_t)subsidyDecreaseBlockCount {
switch (self.chainType) {
case DSChainType_MainNet:
switch (self.chainType.tag) {
case ChainType_MainNet:
return 210240;
case DSChainType_TestNet:
case ChainType_TestNet:
return 210240;
case DSChainType_DevNet:
case ChainType_DevNet:
return 210240;
}
}

- (uint64_t)budgetPaymentsStartBlock {
switch (self.chainType) {
case DSChainType_MainNet:
switch (self.chainType.tag) {
case ChainType_MainNet:
return 328008;
case DSChainType_TestNet:
case ChainType_TestNet:
return 4100;
case DSChainType_DevNet:
case ChainType_DevNet:
return 4100;
}
}
Expand Down
4 changes: 2 additions & 2 deletions DashWallet/Sources/Categories/UITableView+DashWallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ extension UITableView {
func dequeueReusableCell<T: UITableViewCell>(type: T.Type, for indexPath: IndexPath) -> T {
dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as! T
}

func registerClassforHeaderFooterView<T: UITableViewHeaderFooterView>(for type: T.Type) {
register(T.self, forHeaderFooterViewReuseIdentifier: T.reuseIdentifier)
}

func dequeueReusableHeaderFooterView<T: UITableViewHeaderFooterView>(type: T.Type) -> T {
dequeueReusableHeaderFooterView(withIdentifier: T.reuseIdentifier) as! T
}
Expand Down
33 changes: 16 additions & 17 deletions DashWallet/Sources/Models/DWEnvironment.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ - (instancetype)init {

NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if (![userDefaults objectForKey:CURRENT_CHAIN_TYPE_KEY]) {
[userDefaults setInteger:DSChainType_MainNet forKey:CURRENT_CHAIN_TYPE_KEY];
[userDefaults setInteger:ChainType_MainNet forKey:CURRENT_CHAIN_TYPE_KEY];
}
[[DSChainsManager sharedInstance] chainManagerForChain:[DSChain mainnet]]; // initialization
[[DSChainsManager sharedInstance] chainManagerForChain:[DSChain testnet]]; // initialization
Expand All @@ -62,19 +62,19 @@ - (instancetype)init {

- (void)reset {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
DSChainType chainType = [userDefaults integerForKey:CURRENT_CHAIN_TYPE_KEY];
switch (chainType) {
case DSChainType_MainNet:
// DSChainType chainType = [userDefaults integerForKey:CURRENT_CHAIN_TYPE_KEY];
switch ([userDefaults integerForKey:CURRENT_CHAIN_TYPE_KEY]) {
case ChainType_MainNet:
self.currentChain = [DSChain mainnet];
break;
case DSChainType_TestNet:
case ChainType_TestNet:
self.currentChain = [DSChain testnet];
break;
case DSChainType_DevNet: // we will only have evonet
case ChainType_DevNet: // we will only have evonet
self.currentChain = [DSChain devnetWithIdentifier:DWDevnetEvonetIdentifier];
if (!self.currentChain) {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setInteger:DSChainType_MainNet forKey:CURRENT_CHAIN_TYPE_KEY];
[userDefaults setInteger:ChainType_MainNet forKey:CURRENT_CHAIN_TYPE_KEY];
self.currentChain = [DSChain mainnet];
}
break;
Expand Down Expand Up @@ -117,19 +117,19 @@ - (void)clearAllWalletsAndRemovePin:(BOOL)shouldRemovePin {

- (void)switchToMainnetWithCompletion:(void (^)(BOOL success))completion {
if (self.currentChain != [DSChain mainnet]) {
[self switchToNetwork:DSChainType_MainNet withIdentifier:nil withCompletion:completion];
[self switchToNetwork:ChainType_MainNet withIdentifier:nil withCompletion:completion];
}
}

- (void)switchToTestnetWithCompletion:(void (^)(BOOL success))completion {
if (self.currentChain != [DSChain testnet]) {
[self switchToNetwork:DSChainType_TestNet withIdentifier:nil withCompletion:completion];
[self switchToNetwork:ChainType_TestNet withIdentifier:nil withCompletion:completion];
}
}

- (void)switchToEvonetWithCompletion:(void (^)(BOOL success))completion {
if (self.currentChain != [DSChain devnetWithIdentifier:DWDevnetEvonetIdentifier]) {
[self switchToNetwork:DSChainType_DevNet withIdentifier:DWDevnetEvonetIdentifier withCompletion:completion];
[self switchToNetwork:ChainType_DevNet withIdentifier:DWDevnetEvonetIdentifier withCompletion:completion];
}
}

Expand All @@ -155,9 +155,9 @@ - (NSOrderedSet *)evonetServiceLocation {
return [NSOrderedSet orderedSetWithArray:serviceLocations];
}

- (void)switchToNetwork:(DSChainType)chainType withIdentifier:(NSString *)identifier withCompletion:(void (^)(BOOL success))completion {
- (void)switchToNetwork:(ChainType_Tag)chainType withIdentifier:(NSString *)identifier withCompletion:(void (^)(BOOL success))completion {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
DSChainType originalChainType = [userDefaults integerForKey:CURRENT_CHAIN_TYPE_KEY];
ChainType_Tag originalChainType = [userDefaults integerForKey:CURRENT_CHAIN_TYPE_KEY];
if (originalChainType == chainType) {
// Notification isn't send here as the chain remains the same
completion(YES); // didn't really switch but good enough
Expand All @@ -166,13 +166,13 @@ - (void)switchToNetwork:(DSChainType)chainType withIdentifier:(NSString *)identi
DSWallet *wallet = [self currentWallet];
DSChain *destinationChain = nil;
switch (chainType) {
case DSChainType_MainNet:
case ChainType_MainNet:
destinationChain = [DSChain mainnet];
break;
case DSChainType_TestNet:
case ChainType_TestNet:
destinationChain = [DSChain testnet];
break;
case DSChainType_DevNet:
case ChainType_DevNet:
destinationChain = [DSChain devnetWithIdentifier:identifier];
if (!destinationChain && [identifier isEqualToString:DWDevnetEvonetIdentifier]) {
// TODO: add devnet eventually
Expand Down Expand Up @@ -206,8 +206,7 @@ - (void)switchToNetwork:(DSChainType)chainType withIdentifier:(NSString *)identi
if (self.currentChain) {
[[DashSync sharedSyncController] stopSyncForChain:self.currentChain];
}
[userDefaults setInteger:chainType
forKey:CURRENT_CHAIN_TYPE_KEY];
[userDefaults setInteger:chainType forKey:CURRENT_CHAIN_TYPE_KEY];
[self reset];
[self.currentChainManager.peerManager connect];
[[NSNotificationCenter defaultCenter] postNotificationName:DWCurrentNetworkDidChangeNotification
Expand Down
Loading

0 comments on commit 55983c3

Please sign in to comment.