From f4f6cbaf0bfaeb0e8bf77ce27a9981fa48f314fd Mon Sep 17 00:00:00 2001 From: Lukas Korba Date: Thu, 11 May 2023 12:34:09 +0200 Subject: [PATCH] [#1046] Implement SaplingParamsAction - action for sapling param files finished --- .../Block/Actions/SaplingParamsAction.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/ZcashLightClientKit/Block/Actions/SaplingParamsAction.swift b/Sources/ZcashLightClientKit/Block/Actions/SaplingParamsAction.swift index d39c4bc3..0a0cef96 100644 --- a/Sources/ZcashLightClientKit/Block/Actions/SaplingParamsAction.swift +++ b/Sources/ZcashLightClientKit/Block/Actions/SaplingParamsAction.swift @@ -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 }