Compare commits
2 Commits
652bacd3d8
...
83702731a0
Author | SHA1 | Date |
---|---|---|
Lukas Korba | 83702731a0 | |
Lukas Korba | ffc7fd1be9 |
|
@ -6,6 +6,12 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
- The database locking mechanism has been changed to use async/await concurrency approach - the DBActor.
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Call of wipe() resets local (in memory) values.
|
||||||
|
|
||||||
# 2.1.3 - 2024-03-28
|
# 2.1.3 - 2024-03-28
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
|
@ -386,6 +386,8 @@ extension CompactBlockProcessor {
|
||||||
|
|
||||||
try await rewindDownloadBlockAction(to: nil)
|
try await rewindDownloadBlockAction(to: nil)
|
||||||
|
|
||||||
|
await latestBlocksDataProvider.reset()
|
||||||
|
|
||||||
await context.completion(nil)
|
await context.completion(nil)
|
||||||
} catch {
|
} catch {
|
||||||
await context.completion(error)
|
await context.completion(error)
|
||||||
|
|
|
@ -13,6 +13,7 @@ protocol LatestBlocksDataProvider {
|
||||||
var latestBlockHeight: BlockHeight { get async }
|
var latestBlockHeight: BlockHeight { get async }
|
||||||
var walletBirthday: BlockHeight { get async }
|
var walletBirthday: BlockHeight { get async }
|
||||||
|
|
||||||
|
func reset() async
|
||||||
func updateScannedData() async
|
func updateScannedData() async
|
||||||
func updateBlockData() async
|
func updateBlockData() async
|
||||||
func updateWalletBirthday(_ walletBirthday: BlockHeight) async
|
func updateWalletBirthday(_ walletBirthday: BlockHeight) async
|
||||||
|
@ -36,6 +37,13 @@ actor LatestBlocksDataProviderImpl: LatestBlocksDataProvider {
|
||||||
self.rustBackend = rustBackend
|
self.rustBackend = rustBackend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func reset() async {
|
||||||
|
fullyScannedHeight = .zero
|
||||||
|
maxScannedHeight = .zero
|
||||||
|
latestBlockHeight = .zero
|
||||||
|
walletBirthday = .zero
|
||||||
|
}
|
||||||
|
|
||||||
func updateScannedData() async {
|
func updateScannedData() async {
|
||||||
fullyScannedHeight = (try? await rustBackend.fullyScannedHeight()) ?? walletBirthday
|
fullyScannedHeight = (try? await rustBackend.fullyScannedHeight()) ?? walletBirthday
|
||||||
maxScannedHeight = (try? await rustBackend.maxScannedHeight()) ?? walletBirthday
|
maxScannedHeight = (try? await rustBackend.maxScannedHeight()) ?? walletBirthday
|
||||||
|
|
|
@ -671,6 +671,19 @@ class LatestBlocksDataProviderMock: LatestBlocksDataProvider {
|
||||||
}
|
}
|
||||||
var underlyingWalletBirthday: BlockHeight!
|
var underlyingWalletBirthday: BlockHeight!
|
||||||
|
|
||||||
|
// MARK: - reset
|
||||||
|
|
||||||
|
var resetCallsCount = 0
|
||||||
|
var resetCalled: Bool {
|
||||||
|
return resetCallsCount > 0
|
||||||
|
}
|
||||||
|
var resetClosure: (() async -> Void)?
|
||||||
|
|
||||||
|
func reset() async {
|
||||||
|
resetCallsCount += 1
|
||||||
|
await resetClosure!()
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - updateScannedData
|
// MARK: - updateScannedData
|
||||||
|
|
||||||
var updateScannedDataCallsCount = 0
|
var updateScannedDataCallsCount = 0
|
||||||
|
|
Loading…
Reference in New Issue