Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update did core version #13

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let package = Package(
name: "didcomm-swift",
platforms: [
.iOS(.v15),
.macOS(.v12),
.macOS(.v13),
.macCatalyst(.v15),
.tvOS(.v15),
.watchOS(.v8)
Expand All @@ -20,7 +20,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/swift-libp2p/swift-multibase.git", .upToNextMajor(from: "0.0.1")),
.package(url: "https://github.com/beatt83/didcore-swift.git", .upToNextMinor(from: "2.0.0")),
.package(url: "https://github.com/beatt83/didcore-swift.git", .upToNextMinor(from: "2.0.1")),
.package(url: "https://github.com/beatt83/jose-swift.git", .upToNextMajor(from: "3.2.0"))
],
targets: [
Expand Down
4 changes: 2 additions & 2 deletions Sources/DIDCommSwift/Crypto/RecipientKeySelector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct RecipientKeySelector {

let document = try await didResolver.resolve(did: didFrom.did)

guard let method = document.verificationMethods.first(where: { $0.id == signFrom }) else {
guard let method = document.verificationMethods?.first(where: { $0.id == signFrom }) else {
throw DIDCommError.verificationMethodNotFoundForId(signFrom)
}

Expand All @@ -53,7 +53,7 @@ struct RecipientKeySelector {

let document = try await didResolver.resolve(did: didFrom.did)

guard let method = document.verificationMethods.first(where: { $0.id == from }) else {
guard let method = document.verificationMethods?.first(where: { $0.id == from }) else {
throw DIDCommError.verificationMethodNotFoundForId(from)
}

Expand Down
8 changes: 4 additions & 4 deletions Sources/DIDCommSwift/Crypto/SenderKeySelector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct SenderKeySelector {
}
let document = try await didResolver.resolve(did: didTo.did)
if didTo.fragment != nil {
guard let verificationMethod = document.verificationMethods.first(where: { $0.id == to }) else {
guard let verificationMethod = document.verificationMethods?.first(where: { $0.id == to }) else {
return []
}
return [try KeyHelper.fromVerificationMethod(method: verificationMethod)]
Expand All @@ -127,7 +127,7 @@ struct SenderKeySelector {
}
if didTo.fragment != nil {
guard
let verificationMethod = document.verificationMethods.first(where: { $0.id == to }),
let verificationMethod = document.verificationMethods?.first(where: { $0.id == to }),
let methodCurve = try? verificationMethod.getCurve(),
curve == methodCurve
else {
Expand All @@ -150,7 +150,7 @@ extension DIDDocument {
authentication?.map {
switch $0 {
case .stringValue(let value):
return verificationMethods.first { $0.id == value }
return verificationMethods?.first { $0.id == value }
case .verificationMethod(let method):
return method
}
Expand All @@ -161,7 +161,7 @@ extension DIDDocument {
keyAgreement?.map {
switch $0 {
case .stringValue(let value):
return verificationMethods.first { $0.id == value }
return verificationMethods?.first { $0.id == value }
case .verificationMethod(let method):
return method
}
Expand Down
Loading