|
|
|
@ -7,9 +7,15 @@ protocol PromptBackupCoordinatorDelegate: class { |
|
|
|
|
func didFinish(in coordinator: PromptBackupCoordinator) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///We allow user to switch wallets, so it's important to know which wallet we are prompting for. It might not be the current wallet |
|
|
|
|
class PromptBackupCoordinator: Coordinator { |
|
|
|
|
var coordinators: [Coordinator] = [] |
|
|
|
|
weak var delegate: PromptBackupCoordinatorDelegate? |
|
|
|
|
var walletAddress: String |
|
|
|
|
|
|
|
|
|
init(walletAddress: String) { |
|
|
|
|
self.walletAddress = walletAddress |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func start() { |
|
|
|
|
let keystore = try! EtherKeystore() |
|
|
|
@ -19,7 +25,7 @@ class PromptBackupCoordinator: Coordinator { |
|
|
|
|
} |
|
|
|
|
let coordinator = WalletCoordinator(keystore: keystore) |
|
|
|
|
coordinator.delegate = self |
|
|
|
|
let proceed = coordinator.start(.backupWallet) |
|
|
|
|
let proceed = coordinator.start(.backupWallet(address: walletAddress)) |
|
|
|
|
guard proceed else { |
|
|
|
|
finish() |
|
|
|
|
return |
|
|
|
|