From acd172c47143d61d3706e06a6aacb554fafc1d82 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Wed, 18 Dec 2024 14:48:14 +1300 Subject: [PATCH] fix tests --- Blockchain/Tests/BlockchainTests/BlockchainServices.swift | 3 +++ Blockchain/Tests/BlockchainTests/ValidatorServiceTests.swift | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Blockchain/Tests/BlockchainTests/BlockchainServices.swift b/Blockchain/Tests/BlockchainTests/BlockchainServices.swift index d7985125..ae08472e 100644 --- a/Blockchain/Tests/BlockchainTests/BlockchainServices.swift +++ b/Blockchain/Tests/BlockchainTests/BlockchainServices.swift @@ -1,10 +1,12 @@ import Blockchain +import Foundation import Utils class BlockchainServices { let config: ProtocolConfigRef let timeProvider: MockTimeProvider let dataProvider: BlockchainDataProvider + let dataStore: DataStore let eventBus: EventBus let scheduler: MockScheduler let keystore: DevKeyStore @@ -30,6 +32,7 @@ class BlockchainServices { self.genesisBlock = genesisBlock self.genesisState = genesisState dataProvider = try! await BlockchainDataProvider(InMemoryDataProvider(genesisState: genesisState, genesisBlock: genesisBlock)) + dataStore = DataStore(InMemoryDataStore(), basePath: URL(fileURLWithPath: "/tmp/boka-test-data")) storeMiddleware = StoreMiddleware() eventBus = EventBus(eventMiddleware: .serial(Middleware(storeMiddleware), .noError), handlerMiddleware: .noError) diff --git a/Blockchain/Tests/BlockchainTests/ValidatorServiceTests.swift b/Blockchain/Tests/BlockchainTests/ValidatorServiceTests.swift index 8493157d..d927f77d 100644 --- a/Blockchain/Tests/BlockchainTests/ValidatorServiceTests.swift +++ b/Blockchain/Tests/BlockchainTests/ValidatorServiceTests.swift @@ -23,7 +23,8 @@ struct ValidatorServiceTests { keystore: services.keystore, eventBus: services.eventBus, scheduler: services.scheduler, - dataProvider: services.dataProvider + dataProvider: services.dataProvider, + dataStore: services.dataStore ) await validatorService.onSyncCompleted() return (services, validatorService)