From 12032483b439a68db61a4457429409724b518e16 Mon Sep 17 00:00:00 2001 From: metalurgical <97008724+metalurgical@users.noreply.github.com> Date: Wed, 15 May 2024 12:08:54 +0200 Subject: [PATCH] fix: type and case for ShareRequestParams. --- Sources/TorusUtils/Helpers/NodeUtils.swift | 7 +++---- .../Helpers/jsonRPC/Requests/ShareRequestParams.swift | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Sources/TorusUtils/Helpers/NodeUtils.swift b/Sources/TorusUtils/Helpers/NodeUtils.swift index 04144909..e02cc1e0 100644 --- a/Sources/TorusUtils/Helpers/NodeUtils.swift +++ b/Sources/TorusUtils/Helpers/NodeUtils.swift @@ -214,12 +214,12 @@ internal class NodeUtils { verifier_id: verifierParams.verifier_id, extended_verifier_id: verifierParams.extended_verifier_id, idtoken: idToken, - nodeSignatures: nodeSigs, + nodesignatures: nodeSigs, pub_key_x: importShare.pubKeyX, pub_key_y: importShare.pubKeyY, encrypted_share: importShare.encryptedShare, encrypted_share_metadata: importShare.encryptedShareMetadata, - node_index: String(importShare.nodeIndex), + node_index: importShare.nodeIndex, key_type: importShare.keyType, nonce_data: importShare.nonceData, nonce_signature: importShare.nonceSignature, @@ -239,7 +239,6 @@ internal class NodeUtils { let encoder = JSONEncoder() encoder.outputFormatting = .sortedKeys let rpcdata = try encoder.encode(jsonRPCRequest) - var request = try MetadataUtils.makeUrlRequest(url: endpoints[i]) request.httpBody = rpcdata let val = try await URLSession(configuration: .default).data(for: request) @@ -255,7 +254,7 @@ internal class NodeUtils { verifier_id: verifierParams.verifier_id, extended_verifier_id: verifierParams.extended_verifier_id, idtoken: idToken, - nodeSignatures: nodeSigs, + nodesignatures: nodeSigs, // extra_params: extraData sub_verifier_ids: verifierParams.sub_verifier_ids, session_token_exp_second: sessionExpiry, diff --git a/Sources/TorusUtils/Helpers/jsonRPC/Requests/ShareRequestParams.swift b/Sources/TorusUtils/Helpers/jsonRPC/Requests/ShareRequestParams.swift index 12cc5b21..4aa2870f 100644 --- a/Sources/TorusUtils/Helpers/jsonRPC/Requests/ShareRequestParams.swift +++ b/Sources/TorusUtils/Helpers/jsonRPC/Requests/ShareRequestParams.swift @@ -6,12 +6,12 @@ internal struct ShareRequestParams: Codable { public var verifier_id: String? public var extended_verifier_id: String? public var idtoken: String - public var nodeSignatures: [CommitmentRequestResult?] + public var nodesignatures: [CommitmentRequestResult?] public var pub_key_x: String? public var pub_key_y: String? public var encrypted_share: String? public var encrypted_share_metadata: EciesHex? - public var node_index: String? + public var node_index: Int? public var key_type: String? public var nonce_data: String? public var nonce_signature: String?