Skip to content

Commit

Permalink
[fix] updated vptoken encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
dtsiflit committed Dec 18, 2024
1 parent d69251c commit 42fc279
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Sources/Entities/Types/VpToken.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ public struct VpToken: Encodable {

// Helper function to encode individual VerifiablePresentation cases
private func encodeToken(_ token: VerifiablePresentation) throws -> JSON {
let jsonData: Data
switch token {
case .generic(let value):
jsonData = try JSONEncoder().encode(value)
return JSON(value)
case .msoMdoc(let value):
jsonData = try JSONEncoder().encode(value)
return JSON(value)
case .json(let json):
jsonData = try JSONEncoder().encode(json)
return json
}
return try JSON(data: jsonData)
}

public func encode(to encoder: Encoder) throws {
Expand Down

0 comments on commit 42fc279

Please sign in to comment.