-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-enable jettons on restore or watch Ton blockchain
- Loading branch information
Showing
18 changed files
with
279 additions
and
105 deletions.
There are no files selected for viewing
44 changes: 25 additions & 19 deletions
44
UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
UnstoppableWallet/UnstoppableWallet/Core/Managers/EvmAccountRestoreStateManager.swift
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
UnstoppableWallet/UnstoppableWallet/Core/Managers/RestoreStateManager.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import MarketKit | ||
|
||
class RestoreStateManager { | ||
private let storage: RestoreStateStorage | ||
|
||
init(storage: RestoreStateStorage) { | ||
self.storage = storage | ||
} | ||
} | ||
|
||
extension RestoreStateManager { | ||
func restoreState(account: Account, blockchainType: BlockchainType) -> RestoreState { | ||
(try? storage.restoreState(accountId: account.id, blockchainUid: blockchainType.uid)) ?? RestoreState(accountId: account.id, blockchainUid: blockchainType.uid) | ||
} | ||
|
||
func shouldRestore(account: Account, blockchainType: BlockchainType) -> Bool { | ||
restoreState(account: account, blockchainType: blockchainType).shouldRestore | ||
} | ||
|
||
func initialRestored(account: Account, blockchainType: BlockchainType) -> Bool { | ||
restoreState(account: account, blockchainType: blockchainType).initialRestored | ||
} | ||
|
||
func setShouldRestore(account: Account, blockchainType: BlockchainType) { | ||
var state = (try? storage.restoreState(accountId: account.id, blockchainUid: blockchainType.uid)) ?? RestoreState(accountId: account.id, blockchainUid: blockchainType.uid) | ||
state.shouldRestore = true | ||
try? storage.save(restoreState: state) | ||
} | ||
|
||
func setInitialRestored(account: Account, blockchainType: BlockchainType) { | ||
var state = (try? storage.restoreState(accountId: account.id, blockchainUid: blockchainType.uid)) ?? RestoreState(accountId: account.id, blockchainUid: blockchainType.uid) | ||
state.initialRestored = true | ||
try? storage.save(restoreState: state) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
UnstoppableWallet/UnstoppableWallet/Core/Storage/EvmAccountRestoreStateStorage.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.