• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / atala-prism-wallet-sdk-swift / 9175585908

21 May 2024 01:30PM UTC coverage: 38.095% (-0.1%) from 38.239%
9175585908

push

github

goncalo-frade-iohk
feat(agent): report problem message

Fixes ATL-6860

Signed-off-by: goncalo-frade-iohk <goncalo.frade@iohk.io>

0 of 39 new or added lines in 1 file covered. (0.0%)

3952 of 10374 relevant lines covered (38.1%)

14.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/EdgeAgentSDK/EdgeAgent/Sources/Protocols/Others/ReportProblemMessage.swift
1
import Core
2
import Domain
3
import Foundation
4

5
public struct ReportProblemMessage {
6

7
    public struct Body: Codable {
8
        public let code: String
9
        public let comment: String?
10
        public let args: [String]?
11
        public let escalateTo: String?
12

NEW
13
        init(code: String, comment: String?, args: [String]?, escalateTo: String?) {
×
NEW
14
            self.code = code
×
NEW
15
            self.comment = comment
×
NEW
16
            self.args = args
×
NEW
17
            self.escalateTo = escalateTo
×
NEW
18
        }
×
19
    }
20

21
    public let id: String
NEW
22
    public let type = ProtocolTypes.didcommReportProblem.rawValue
×
23
    public let from: DID
24
    public let to: DID
25
    public let date: Date
26
    public let body: Body
27

28
    public init(
29
        id: String = UUID().uuidString,
30
        from: DID,
31
        to: DID,
32
        body: Body,
33
        date: Date = Date()
NEW
34
    ) {
×
NEW
35
        self.id = id
×
NEW
36
        self.from = from
×
NEW
37
        self.to = to
×
NEW
38
        self.body = body
×
NEW
39
        self.date = date
×
NEW
40
    }
×
41

NEW
42
    public init?(fromMessage: Message) throws {
×
NEW
43
        guard
×
NEW
44
            fromMessage.piuri == ProtocolTypes.didcommReportProblem.rawValue,
×
NEW
45
            let from = fromMessage.from,
×
NEW
46
            let to = fromMessage.to
×
NEW
47
        else {
×
NEW
48
            return nil
×
NEW
49
        }
×
NEW
50
        self.id = fromMessage.id
×
NEW
51
        self.from = from
×
NEW
52
        self.to = to
×
NEW
53
        self.body = try JSONDecoder.didComm().decode(Body.self, from: fromMessage.body)
×
NEW
54
        self.date = fromMessage.createdTime
×
NEW
55
    }
×
56

NEW
57
    public func makeMessage() throws -> Message {
×
NEW
58
        return Message(
×
NEW
59
            id: id,
×
NEW
60
            piuri: type,
×
NEW
61
            from: from,
×
NEW
62
            to: to,
×
NEW
63
            body: try JSONEncoder.didComm().encode(body),
×
NEW
64
            createdTime: date,
×
NEW
65
            direction: .sent
×
NEW
66
        )
×
NEW
67
    }
×
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc