[#1046] Implement SaplingParamsAction

- action for sapling param files finished
This commit is contained in:
Lukas Korba 2023-05-11 12:34:09 +02:00 committed by Michal Fousek
parent 63e852aeed
commit f4f6cbaf0b
1 changed files with 5 additions and 3 deletions

View File

@ -8,15 +8,17 @@
import Foundation
class SaplingParamsAction {
init(container: DIContainer) { }
let saplingParametersHandler: SaplingParametersHandler
init(container: DIContainer) {
saplingParametersHandler = container.resolve(SaplingParametersHandler.self)
}
}
extension SaplingParamsAction: Action {
var removeBlocksCacheWhenFailed: Bool { false }
func run(with context: ActionContext, didUpdate: @escaping (CompactBlockProcessorNG.Event) async -> Void) async throws -> ActionContext {
// Download files with sapling params.
try await saplingParametersHandler.handleIfNeeded()
await context.update(state: .scanDownloaded)
return context
}