[#1046] Implement SaplingParamsAction
- action for sapling param files finished
This commit is contained in:
parent
63e852aeed
commit
f4f6cbaf0b
|
@ -8,15 +8,17 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
class SaplingParamsAction {
|
class SaplingParamsAction {
|
||||||
init(container: DIContainer) { }
|
let saplingParametersHandler: SaplingParametersHandler
|
||||||
|
init(container: DIContainer) {
|
||||||
|
saplingParametersHandler = container.resolve(SaplingParametersHandler.self)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension SaplingParamsAction: Action {
|
extension SaplingParamsAction: Action {
|
||||||
var removeBlocksCacheWhenFailed: Bool { false }
|
var removeBlocksCacheWhenFailed: Bool { false }
|
||||||
|
|
||||||
func run(with context: ActionContext, didUpdate: @escaping (CompactBlockProcessorNG.Event) async -> Void) async throws -> ActionContext {
|
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)
|
await context.update(state: .scanDownloaded)
|
||||||
return context
|
return context
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue