Skip to content

Commit

Permalink
Merge pull request #137 from velocitycareerlabs/VL-8447-v2.6.8
Browse files Browse the repository at this point in the history
rewrite executor
  • Loading branch information
michaelavoyan authored Oct 23, 2024
2 parents 2431b1b + 053a339 commit 8370d0d
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 33 deletions.
8 changes: 4 additions & 4 deletions VCL/VCL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 151;
CURRENT_PROJECT_VERSION = 152;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 7DDDGP43MJ;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -1921,7 +1921,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.6.7;
MARKETING_VERSION = 2.6.8;
PRODUCT_BUNDLE_IDENTIFIER = io.velocitycareerlabs.VCL;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1938,7 +1938,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 151;
CURRENT_PROJECT_VERSION = 152;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 7DDDGP43MJ;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand All @@ -1951,7 +1951,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.6.7;
MARKETING_VERSION = 2.6.8;
PRODUCT_BUNDLE_IDENTIFIER = io.velocitycareerlabs.VCL;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
32 changes: 16 additions & 16 deletions VCL/VCL/impl/VclBlocksProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class VclBlocksProvider {
NetworkServiceImpl(),
CacheServiceImpl()
),
ExecutorImpl()
ExecutorImpl.instance
)
)
}
Expand All @@ -115,7 +115,7 @@ class VclBlocksProvider {
CacheServiceImpl()
),
credenctiialTypes,
ExecutorImpl(),
ExecutorImpl.instance,
DispatcherImpl()
)
)
Expand All @@ -128,7 +128,7 @@ class VclBlocksProvider {
NetworkServiceImpl(),
CacheServiceImpl()
),
ExecutorImpl()
ExecutorImpl.instance
)
)
}
Expand All @@ -148,7 +148,7 @@ class VclBlocksProvider {
try chooseJwtVerifyService(cryptoServicesDescriptor)
),
PresentationRequestByDeepLinkVerifierImpl(),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -163,7 +163,7 @@ class VclBlocksProvider {
try chooseJwtSignService(cryptoServicesDescriptor),
try chooseJwtVerifyService(cryptoServicesDescriptor)
),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -172,7 +172,7 @@ class VclBlocksProvider {
OrganizationsRepositoryImpl(
NetworkServiceImpl()
),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -191,7 +191,7 @@ class VclBlocksProvider {
try chooseJwtVerifyService(cryptoServicesDescriptor)
),
CredentialManifestByDeepLinkVerifierImpl(),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -206,7 +206,7 @@ class VclBlocksProvider {
try chooseJwtSignService(cryptoServicesDescriptor),
try chooseJwtVerifyService(cryptoServicesDescriptor)
),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -215,7 +215,7 @@ class VclBlocksProvider {
ExchangeProgressRepositoryImpl(
NetworkServiceImpl()
),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -225,7 +225,7 @@ class VclBlocksProvider {
NetworkServiceImpl()
),
OffersByDeepLinkVerifierImpl(),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -239,7 +239,7 @@ class VclBlocksProvider {
credentialIssuerVerifier = CredentialIssuerVerifierImpl(
credentialTypesModel,
NetworkServiceImpl(),
ExecutorImpl()
ExecutorImpl.instance
)
}
return FinalizeOffersUseCaseImpl(
Expand All @@ -252,7 +252,7 @@ class VclBlocksProvider {
credentialIssuerVerifier,
CredentialDidVerifierImpl(),
CredentialsByDeepLinkVerifierImpl(),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -261,7 +261,7 @@ class VclBlocksProvider {
CredentialTypesUIFormSchemaRepositoryImpl(
NetworkServiceImpl()
),
ExecutorImpl(),
ExecutorImpl.instance,
DispatcherImpl()
)
}
Expand All @@ -271,7 +271,7 @@ class VclBlocksProvider {
VerifiedProfileRepositoryImpl(
NetworkServiceImpl()
),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -283,7 +283,7 @@ class VclBlocksProvider {
try chooseJwtSignService(cryptoServicesDescriptor),
try chooseJwtVerifyService(cryptoServicesDescriptor)
),
ExecutorImpl()
ExecutorImpl.instance
)
}

Expand All @@ -294,7 +294,7 @@ class VclBlocksProvider {
KeyServiceRepositoryImpl(
try chooseKeyService(cryptoServicesDescriptor)
),
ExecutorImpl()
ExecutorImpl.instance
)
}
}
11 changes: 8 additions & 3 deletions VCL/VCL/impl/data/infrastructure/executors/ExecutorImpl.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ExecutorImpl.swift
//
//
//
// Created by Michael Avoyan on 02/05/2021.
//
Expand All @@ -10,10 +10,15 @@
import Foundation

final class ExecutorImpl: Executor {
private let dispatchQueueMain = DispatchQueue.main

// Singleton instance
static let instance = ExecutorImpl()

// Private init to prevent external instantiation
private init() {}

func runOnMain(_ block: @escaping @Sendable () -> Void) {
self.dispatchQueueMain.async {
DispatchQueue.main.async {
block()
}
}
Expand Down
4 changes: 2 additions & 2 deletions VCL/VCLTests/usecases/CountriesUseCaseTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class CountriesUseCaseTest: XCTestCase {
),
EmptyCacheService()
),
ExecutorImpl()
ExecutorImpl.instance
)

subject.getCountries(cacheSequence: 1) {
Expand Down Expand Up @@ -56,7 +56,7 @@ final class CountriesUseCaseTest: XCTestCase {
NetworkServiceSuccess(
validResponse: "wrong payload"
), EmptyCacheService() ),
ExecutorImpl()
ExecutorImpl.instance
)

subject.getCountries(cacheSequence: 1) {
Expand Down
4 changes: 2 additions & 2 deletions VCL/VCLTests/usecases/ExchangeProgressUseCaseTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class ExchangeProgressUseCaseTest: XCTestCase {
ExchangeProgressRepositoryImpl(
NetworkServiceSuccess(validResponse: ExchangeProgressMocks.ExchangeProgressJson)
),
ExecutorImpl()
ExecutorImpl.instance
)
let submissionResult = VCLSubmissionResult(sessionToken: VCLToken(value: ""), exchange: VCLExchange(), jti: "", submissionId: "")
let exchangeDescriptor = VCLExchangeDescriptor(
Expand All @@ -46,7 +46,7 @@ final class ExchangeProgressUseCaseTest: XCTestCase {
ExchangeProgressRepositoryImpl(
NetworkServiceSuccess(validResponse: "wrong payload")
),
ExecutorImpl()
ExecutorImpl.instance
)
let submissionResult = VCLSubmissionResult(sessionToken: VCLToken(value: ""), exchange: VCLExchange(), jti: "", submissionId: "")
let exchangeDescriptor = VCLExchangeDescriptor(
Expand Down
12 changes: 6 additions & 6 deletions VCL/VCLTests/verifiers/ProfileServiceTypeVerifierTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,47 +26,47 @@ class ProfileServiceTypeVerifierTest: XCTestCase {
VerifiedProfileRepositoryImpl(
NetworkServiceSuccess(validResponse: VerifiedProfileMocks.VerifiedProfileIssuerInspectorJsonStr)
),
ExecutorImpl()
ExecutorImpl.instance
)
)
subject2 = ProfileServiceTypeVerifier(
verifiedProfileUseCase: VerifiedProfileUseCaseImpl(
VerifiedProfileRepositoryImpl(
NetworkServiceSuccess(validResponse: VerifiedProfileMocks.VerifiedProfileInspectorJsonStr)
),
ExecutorImpl()
ExecutorImpl.instance
)
)
subject3 = ProfileServiceTypeVerifier(
verifiedProfileUseCase: VerifiedProfileUseCaseImpl(
VerifiedProfileRepositoryImpl(
NetworkServiceSuccess(validResponse: VerifiedProfileMocks.VerifiedProfileNotaryIssuerJsonStr)
),
ExecutorImpl()
ExecutorImpl.instance
)
)
subject4 = ProfileServiceTypeVerifier(
verifiedProfileUseCase: VerifiedProfileUseCaseImpl(
VerifiedProfileRepositoryImpl(
NetworkServiceSuccess(validResponse: VerifiedProfileMocks.VerifiedProfileNotaryIssuerJsonStr)
),
ExecutorImpl()
ExecutorImpl.instance
)
)
subject5 = ProfileServiceTypeVerifier(
verifiedProfileUseCase: VerifiedProfileUseCaseImpl(
VerifiedProfileRepositoryImpl(
NetworkServiceSuccess(validResponse: VerifiedProfileMocks.VerifiedProfileIssuerJsonStr1)
),
ExecutorImpl()
ExecutorImpl.instance
)
)
subject6 = ProfileServiceTypeVerifier(
verifiedProfileUseCase: VerifiedProfileUseCaseImpl(
VerifiedProfileRepositoryImpl(
NetworkServiceSuccess(validResponse: VerifiedProfileMocks.VerifiedProfileIssuerInspectorJsonStr)
),
ExecutorImpl()
ExecutorImpl.instance
)
)
}
Expand Down

0 comments on commit 8370d0d

Please sign in to comment.