Skip to content

Commit

Permalink
FMT
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenbf committed Oct 4, 2024
1 parent 276ac6b commit 45c9dd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions Sources/Concordium/Integration/WalletConnect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ extension WalletConnectSignMessageParam: Decodable {
private enum CodingKeys: String, CodingKey {
case message
}

private struct DataJSON: Decodable {
/// Hex
let data: String
Expand Down
11 changes: 6 additions & 5 deletions Tests/ConcordiumTests/Integration/WalletConnectTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ final class WalletConnectTest: XCTestCase {
""".data(using: .utf8)!
let formatter = ISO8601DateFormatter()
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]

let value = try decoder.decode(WalletConnectRequestVerifiablePresentationParam.self, from: json)
let expected = try WalletConnectRequestVerifiablePresentationParam(challenge: Data(hex: "010203"), credentialStatements: [
.account(issuers: [0,1,2], statement: [
.account(issuers: [0, 1, 2], statement: [
.revealAttribute(statement: RevealAttributeStatementV1(attributeTag: .firstName)),
.attributeInSet(statement: AttributeInSetStatementV1(attributeTag: .nationality, set: ["DK", "NO"]))
.attributeInSet(statement: AttributeInSetStatementV1(attributeTag: .nationality, set: ["DK", "NO"])),
]),
.web3id(issuers: [ContractAddress(index: 1, subindex: 0), ContractAddress(index: 42, subindex: 1337)], statement: [
.revealAttribute(statement: RevealAttributeStatementV2(attributeTag: "something")),
Expand All @@ -231,9 +231,10 @@ final class WalletConnectTest: XCTestCase {
.attributeInRange(statement: AttributeInRangeStatementV2(
attributeTag: "time",
lower: .timestamp(value: formatter.date(from: "2022-10-03T08:38:18.738Z")!),
upper: .timestamp(value: formatter.date(from: "2024-10-03T08:38:18.738Z")!))
upper: .timestamp(value: formatter.date(from: "2024-10-03T08:38:18.738Z")!)
)
])
),
]),
])
XCTAssertEqual(value, expected)
}
Expand Down

0 comments on commit 45c9dd2

Please sign in to comment.