Skip to content

Commit

Permalink
fix: remove force unwrap on makeUrlRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
metalurgical committed Oct 12, 2023
1 parent 65cc6ec commit b2d319f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/TorusUtils/Extensions/TorusUtils+extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ extension TorusUtils {
guard let encodedUnwrapped = encoded else {
throw TorusUtilError.runtime("Unable to serialize dictionary into JSON. \(dictionary)")
}
var request = try! makeUrlRequest(url: "\(legacyMetadataHost)/get")
var request = try makeUrlRequest(url: "\(legacyMetadataHost)/get")
request.httpBody = encodedUnwrapped
do {
let val = try await urlSession.data(for: request)
Expand Down Expand Up @@ -1273,7 +1273,7 @@ extension TorusUtils {
let SignerObject = JSONRPCrequest(method: JRPC_METHODS.LEGACY_KEY_ASSIGN, params: ["verifier": verifier, "verifier_id": verifierId])
do {
let rpcdata = try encoder.encode(SignerObject)
var request = try! makeUrlRequest(url: signerHost)
var request = try makeUrlRequest(url: signerHost)
request.addValue(torusNodePubs[nodeNum].getX().lowercased(), forHTTPHeaderField: "pubKeyX")
request.addValue(torusNodePubs[nodeNum].getY().lowercased(), forHTTPHeaderField: "pubKeyY")
switch network {
Expand Down

0 comments on commit b2d319f

Please sign in to comment.