Skip to content

Commit

Permalink
feat(pluto): add DID store and provider
Browse files Browse the repository at this point in the history
Fixes ATL-2355
  • Loading branch information
goncalo-frade-iohk committed Dec 1, 2022
1 parent 063c5bb commit d6010d2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ excluded:
- Tests/PrismSwiftSDKTests
- Castor/Sources/DIDParser/DIDGrammar
- Castor/Tests
- Castor/Sources/protobuf
- Apollo/Tests
- Domain/Tests
- Authenticate/Tests
Expand Down
15 changes: 15 additions & 0 deletions Pluto/Sources/Domain/Providers/DIDProvider.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Combine
import Domain

protocol DIDProvider {
func getAll() -> AnyPublisher<[(did: DID, keyPairIndex: Int, alias: String?)], Error>
func getDIDInfo(
alias: String
) -> AnyPublisher<[(did: DID, keyPairIndex: Int, alias: String?)], Error>
func getDIDInfo(
did: DID
) -> AnyPublisher<(did: DID, keyPairIndex: Int, alias: String?)?, Error>
func getDIDInfo(
keyPairIndex: Int
) -> AnyPublisher<(did: DID, keyPairIndex: Int, alias: String?)?, Error>
}
14 changes: 14 additions & 0 deletions Pluto/Sources/Domain/Stores/DIDStore.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Combine
import Domain

protocol DIDStore {
func addDID(did: DID, keyPairIndex: Int, alias: String?) -> AnyPublisher<Void, Error>
func removeDID(did: DID) -> AnyPublisher<Void, Error>
func removeAll() -> AnyPublisher<Void, Error>
}

extension DIDStore {
func addDID(did: DID, keyPairIndex: Int, alias: String? = nil) -> AnyPublisher<Void, Error> {
addDID(did: did, keyPairIndex: keyPairIndex, alias: alias)
}
}

0 comments on commit d6010d2

Please sign in to comment.