Skip to content

Commit

Permalink
Fix warnings (#115)
Browse files Browse the repository at this point in the history
Signed-off-by: conanoc <conanoc@gmail.com>
  • Loading branch information
conanoc authored Jun 12, 2024
1 parent 3881418 commit e9e3b2b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
1 change: 1 addition & 0 deletions BasicTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
{
"skippedTests" : [
"AgentTest",
"ConnectionlessExchangeTest",
"CredentialsTest",
"LedgerServiceTest",
"OobTest\/testCreateWithOfferCredentialMessage()",
Expand Down
15 changes: 5 additions & 10 deletions Sources/AriesFramework/agent/MessageReceiver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,12 @@ public class MessageReceiver {
}

func findConnectionByMessageThreadId(message: AgentMessage) async throws -> ConnectionRecord? {
guard let pthId = message.thread?.parentThreadId else {
guard let pthId = message.thread?.parentThreadId,
let oobRecord = try await agent.outOfBandService.findByInvitationId(pthId),
let invitationKey = try oobRecord.outOfBandInvitation.invitationKey() else {
return nil
}
guard let oobRecord = try await agent.outOfBandService.findByInvitationId(pthId) else {
return nil
}
guard let invitationKey = try oobRecord.outOfBandInvitation.invitationKey() else {
return nil
}
let connection = await agent.connectionService.findByInvitationKey(invitationKey)
return connection
return await agent.connectionService.findByInvitationKey(invitationKey)
}

func updateConnectionTheirDidDoc(_ connection: inout ConnectionRecord, senderKey: String?) async throws {
Expand All @@ -86,7 +81,7 @@ public class MessageReceiver {
recipientKeys: [senderKey]
).asDidDocService()

var theirDidDoc = DidDoc(
let theirDidDoc = DidDoc(
id: senderKey,
publicKey: [],
service: [service],
Expand Down
2 changes: 1 addition & 1 deletion Sources/AriesFramework/connection/JwsService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class JwsService {
let protected = try JSONSerialization.jsonObject(with: protectedJson) as? [String: Any],
let signature = Data(base64Encoded: firstSig.signature.base64urlToBase64()),
let jwk = protected["jwk"] else {
throw AriesFrameworkError.frameworkError("Invalid Jws: \(firstSig)")
throw AriesFrameworkError.frameworkError("Invalid Jws: \(String(describing: firstSig))")
}
let jwkData = try JSONSerialization.data(withJSONObject: jwk)
let jwkString = String(data: jwkData, encoding: .utf8)!
Expand Down
2 changes: 1 addition & 1 deletion Sources/AriesFramework/oob/OutOfBandCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class OutOfBandCommand {
}
}

var outOfBandRecord = OutOfBandRecord(
let outOfBandRecord = OutOfBandRecord(
id: OutOfBandRecord.generateId(),
createdAt: Date(),
outOfBandInvitation: outOfBandInvitation,
Expand Down
3 changes: 1 addition & 2 deletions Sources/AriesFramework/proofs/ProofService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ProofService {
let message = RequestPresentationMessage(comment: comment, requestPresentationAttachments: [attachment])

let proofRecord = ProofExchangeRecord(
connectionId: connectionRecord?.id ?? "proof-request",
connectionId: connectionRecord?.id ?? "connectionless-proof-request",
threadId: message.threadId,
state: .RequestSent,
autoAcceptProof: autoAcceptProof)
Expand Down Expand Up @@ -132,7 +132,6 @@ public class ProofService {
*/
public func processPresentation(messageContext: InboundMessageContext) async throws -> ProofExchangeRecord {
let presentationMessage = try JSONDecoder().decode(PresentationMessage.self, from: Data(messageContext.plaintextMessage.utf8))
let connection = try messageContext.assertReadyConnection()

var proofRecord = try await agent.proofRepository.getByThreadAndConnectionId(
threadId: presentationMessage.threadId,
Expand Down

0 comments on commit e9e3b2b

Please sign in to comment.