From bef89f20e24a7dec40f88ef33dea2ab39ba70f6f Mon Sep 17 00:00:00 2001 From: Marcus Arnett Date: Wed, 21 Feb 2024 15:24:47 -0500 Subject: [PATCH] Version bug fix for iOS devices --- Sources/SuiKit/Types/Structs/Cryptography/Signature.swift | 2 +- Tests/SuiKitTests/E2E/Utils/KioskToolbox.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/SuiKit/Types/Structs/Cryptography/Signature.swift b/Sources/SuiKit/Types/Structs/Cryptography/Signature.swift index d5555ef..01d6a12 100644 --- a/Sources/SuiKit/Types/Structs/Cryptography/Signature.swift +++ b/Sources/SuiKit/Types/Structs/Cryptography/Signature.swift @@ -101,7 +101,7 @@ public struct Signature: Equatable, KeyProtocol { let pubKey = try SECP256K1PublicKey(data: Data(pubKeyBytes)) return Signature(signature: Data(signature), publickey: pubKey.key, signatureScheme: .SECP256K1) } else if signatureScheme == "SECP256R1" { - if #available(macOS 13.0, *) { + if #available(macOS 13.0, iOS 16.0, *) { let signature = Array(bytes[1...(bytes.count - SECP256R1PublicKey.LENGTH)]) let pubKeyBytes = Array(bytes[(1 + signature.count)...]) let pubKey = try SECP256R1PublicKey(data: Data(pubKeyBytes)) diff --git a/Tests/SuiKitTests/E2E/Utils/KioskToolbox.swift b/Tests/SuiKitTests/E2E/Utils/KioskToolbox.swift index fcf750b..f47f05b 100644 --- a/Tests/SuiKitTests/E2E/Utils/KioskToolbox.swift +++ b/Tests/SuiKitTests/E2E/Utils/KioskToolbox.swift @@ -8,6 +8,7 @@ import Foundation import SuiKit +@available(iOS 16.0, *) internal struct KioskToolbox { public let testToolbox: TestToolbox public let kioskClient: KioskClient