Merge pull request #1309 from LukasKorba/1308-Enhancing-seems-to-not-process-all-ranges
[#1308] Enhancement seems to not process all ranges
This commit is contained in:
commit
bd3ec59f09
|
@ -4,6 +4,13 @@ All notable changes to this library will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
# 2.0.3 - 2023-10-20
|
||||
|
||||
## Fixed
|
||||
|
||||
### [#1308] Enhancing seems to not process all ranges
|
||||
The enhancing of the transactions now processes all the blocks suggested by scan ranges. The issue was that when new scan ranges were suggested the value that drives the enhancing range computation wasn't reset, so when higher ranges were processed, the lower ranges were skipped. This fix ensures all transaction data are properly set, as well as fixing eventStream `.foundTransaction` reporting.
|
||||
|
||||
# 2.0.2 - 2023-10-12
|
||||
|
||||
## Changed
|
||||
|
|
|
@ -43,6 +43,7 @@ extension ProcessSuggestedScanRangesAction: Action {
|
|||
firstUnenhancedHeight [DB]: \(rangeStartExclusive + 1)
|
||||
""")
|
||||
|
||||
await context.update(lastEnhancedHeight: nil)
|
||||
await context.update(lastScannedHeight: rangeStartExclusive)
|
||||
await context.update(lastDownloadedHeight: rangeStartExclusive)
|
||||
await context.update(syncControlData: syncControlData)
|
||||
|
|
|
@ -66,6 +66,7 @@ final class ProcessSuggestedScanRangesActionTests: ZcashTestCase {
|
|||
|
||||
do {
|
||||
let context = ActionContextMock.default()
|
||||
context.updateLastEnhancedHeightClosure = { _ in }
|
||||
context.updateLastScannedHeightClosure = { _ in }
|
||||
context.updateLastDownloadedHeightClosure = { _ in }
|
||||
context.updateSyncControlDataClosure = { _ in }
|
||||
|
@ -78,6 +79,12 @@ final class ProcessSuggestedScanRangesActionTests: ZcashTestCase {
|
|||
nextContextMock.updateRequestedRewindHeightCalled,
|
||||
"context.update(requestedRewindHeight:) is not expected to be called"
|
||||
)
|
||||
|
||||
let enhancedValue = nextContextMock.updateLastEnhancedHeightReceivedLastEnhancedHeight
|
||||
XCTAssertNil(
|
||||
enhancedValue,
|
||||
"context.update(updateLastEnhancedHeight:) is expected to reset the value to nil but received \(enhancedValue)"
|
||||
)
|
||||
} else {
|
||||
XCTFail("`nextContext` is not the ActionContextMock")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue