Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
metalurgical committed Jul 19, 2024
1 parent f7b25f0 commit d23b2f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Sources/TorusUtils/Helpers/MetadataUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,8 @@ internal class MetadataUtils {
let urlSession = URLSession(configuration: .default)
let val = try await urlSession.data(for: request)
let data: GetMetadataResponse = try JSONDecoder().decode(GetMetadataResponse.self, from: val.0)
let msg: String = data.message ?? "0"
guard
let ret = BigUInt(msg, radix: 16)
else {
throw TorusUtilError.decodingFailed("Message value not correct or nil in \(data)")
}
let msg: String = data.message
let ret = BigUInt(msg, radix: 16)!
return ret
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

internal struct GetMetadataResponse: Codable {
public var message: String?
public var message: String

public init(message: String) {
self.message = message
Expand Down

0 comments on commit d23b2f3

Please sign in to comment.