Skip to content

Commit

Permalink
fix: no longer wait for rescan command to return a response when usin…
Browse files Browse the repository at this point in the history
…g WalletImport.swift

- fix UI issue on node table
- fix Alert not showing when import successfully finished on macOS
- Add 0.1.80 dmg
  • Loading branch information
Fonta1n3 committed Sep 16, 2020
1 parent ab8315a commit f1017fe
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 81 deletions.
Binary file renamed FullyNoded.dmg → FullyNoded-0.1.80.dmg
Binary file not shown.
16 changes: 16 additions & 0 deletions FullyNoded-0.1.80.dmg.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEHHIndjZHoiFuAuU5Al6a0tOsD8oFAl9hixUACgkQAl6a0tOs
D8r+6xAApTjSnMzEXcS46IeGO+g8Kgcw5ioEs2ncs5om7erS2W77e2Vxqicq1/RR
/aah8gJhjN3QGCkkPVM+M/jfadViE/Q5e5VhWoFIHqSNqxm0KfdecyVnrXPYxwXT
88naC3rM6gdM/LvAdEZrDi1qplf1foqdz677umU05fESCLuGvRnafm2d4GLZ93DQ
1FbcDKZjJlT7SvfJOYVlsuKzVZdtNCNSC9134xHab0MQhBRmY42IUU46fc4lxJbL
v+d7ZZXP+E7E7StObp3lSYu3GlfoCRZ4dhjpVSlQjqsDomWW7yYMOQuSHJ+cfUIs
6JJ5FMBJWkjBI1S1bHJS8GSNRIkQdtOhdPRxetqslViqxCnwZpl8mCBdC8labOt0
hQhORKqv3t9ColmI5PdiKOwl9UfPXECb+fegVto0TN8Ukwg4+NRee4T5ShQXjwAP
xhOCLp69XksZ6AF53D/taMq9VqrDz1TkyXA/KHLm7327GVC4tbPskf+iz2XagO6A
uIZ17l6q7dHXcYekc5hfgvOObZ3Wc8ZJE+V9Dywx0yx6vxU4+zIrYCX7Seh8zeu7
G4/0AaVKLVbL0nkB47vs+R0uJO6pXdV4f78ekC+cSahOSjbgOUjk8LbSBpfUdEbg
0+0qk/FQ0YLq6Rik/qI0T0ND9GLPMOFtpMbVCoC7FqauSoEUsFM=
=pN2R
-----END PGP SIGNATURE-----
16 changes: 0 additions & 16 deletions FullyNoded.dmg.asc

This file was deleted.

8 changes: 4 additions & 4 deletions FullyNoded.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 234;
CURRENT_PROJECT_VERSION = 235;
DEVELOPMENT_TEAM = 8JHDU5M9KD;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1409,7 +1409,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.314;
MARKETING_VERSION = 1.315;
PRODUCT_BUNDLE_IDENTIFIER = com.fontaine.FullyNoded;
"PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = com.fontaine.fullynodedmacos;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1434,7 +1434,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 234;
CURRENT_PROJECT_VERSION = 235;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 8JHDU5M9KD;
"ENABLE_HARDENED_RUNTIME[sdk=macosx*]" = YES;
Expand All @@ -1450,7 +1450,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.314;
MARKETING_VERSION = 1.315;
PRODUCT_BUNDLE_IDENTIFIER = com.fontaine.FullyNoded;
"PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = com.fontaine.fullynodedmacos;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
98 changes: 53 additions & 45 deletions FullyNoded/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,13 @@ class ImportExtendedKeysViewController: UIViewController, UITableViewDelegate, U
}

private func importSuccess() {
print("importSuccess")
DispatchQueue.main.async { [unowned vc = self] in
let alert = UIAlertController(title: "Keys imported successfully!", message: "If you selected a rescan date your node will now be rescanning, you will need to wait for the rescan to complete before your balances will show up. You can check the scan status in Tools > Get Wallet Info. Tap Done to go back.", preferredStyle: .actionSheet)
var alertStyle = UIAlertController.Style.actionSheet
if (UIDevice.current.userInterfaceIdiom == .pad) {
alertStyle = UIAlertController.Style.alert
}
let alert = UIAlertController(title: "Keys imported successfully!", message: "If you selected a rescan date your node will now be rescanning, you will need to wait for the rescan to complete before your balances will show up. You can check the scan status in Tools > Get Wallet Info. Tap Done to go back.", preferredStyle: alertStyle)
alert.addAction(UIAlertAction(title: "Done", style: .cancel, handler: { action in
DispatchQueue.main.async { [unowned vc = self] in
vc.navigationController?.popToRootViewController(animated: true)
Expand All @@ -355,8 +360,13 @@ class ImportExtendedKeysViewController: UIViewController, UITableViewDelegate, U
}

private func importWithWarning(warning: String) {
print("importWithWarning")
DispatchQueue.main.async { [unowned vc = self] in
let alert = UIAlertController(title: "Keys imported with a warning!", message: "Warning: \(warning)\n\nIf you selected a rescan date your node will now be rescanning, you will need to wait for the rescan to complete before your balances will show up. You can check the scan status in Tools > Get Wallet Info. Tap Done to go back.", preferredStyle: .actionSheet)
var alertStyle = UIAlertController.Style.actionSheet
if (UIDevice.current.userInterfaceIdiom == .pad) {
alertStyle = UIAlertController.Style.alert
}
let alert = UIAlertController(title: "Keys imported with a warning!", message: "Warning: \(warning)\n\nIf you selected a rescan date your node will now be rescanning, you will need to wait for the rescan to complete before your balances will show up. You can check the scan status in Tools > Get Wallet Info. Tap Done to go back.", preferredStyle: alertStyle)
alert.addAction(UIAlertAction(title: "Done", style: .cancel, handler: { action in
DispatchQueue.main.async { [unowned vc = self] in
vc.navigationController?.popToRootViewController(animated: true)
Expand Down
30 changes: 17 additions & 13 deletions FullyNoded/Wallet Logic/ImportWallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,21 @@ class ImportWallet {
CoreDataService.retrieveEntity(entityName: .wallets) { (wallets) in
var walletExists = false
if wallets != nil {
for (i, wallet) in wallets!.enumerated() {
let walletStruct = Wallet(dictionary: wallet)
if walletStruct.name == walletToBeStruct.name {
walletExists = true
}
if i + 1 == wallets!.count {
completion(walletExists)
if wallets!.count > 0 {
for (i, wallet) in wallets!.enumerated() {
let walletStruct = Wallet(dictionary: wallet)
if walletStruct.name == walletToBeStruct.name {
walletExists = true
}
if i + 1 == wallets!.count {
completion(walletExists)
}
}
} else {
completion(false)
}
} else {
completion(false)
}
}
}
Expand Down Expand Up @@ -286,16 +292,14 @@ class ImportWallet {
if let pruned = dict["pruned"] as? Bool {
if pruned {
if let pruneHeight = dict["pruneheight"] as? Int {
Reducer.makeCommand(command: .rescanblockchain, param: "\(pruneHeight)") { (response, errorMessage) in
saveLocally(wallet: wallet, completion: completion)
}
Reducer.makeCommand(command: .rescanblockchain, param: "\(pruneHeight)") { (_, _) in }
saveLocally(wallet: wallet, completion: completion)
} else {
completion((false, errorMessage ?? "error getting prune height"))
}
} else {
Reducer.makeCommand(command: .rescanblockchain, param: "") { (response, errorMessage) in
saveLocally(wallet: wallet, completion: completion)
}
Reducer.makeCommand(command: .rescanblockchain, param: "") { (_, _) in }
saveLocally(wallet: wallet, completion: completion)
}
} else {
completion((false, errorMessage ?? "error getting prune info"))
Expand Down

0 comments on commit f1017fe

Please sign in to comment.