diff --git a/Package.resolved b/Package.resolved index 38ae8640..150c530f 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "6a7b6f94e12ad64740435b6a1f32724d65be46fe7a993e5ced1b75ca71949624", + "originHash" : "39ed8c4de5a35df098c4136c5fd9af5dca9968bb7f2a853a5583c6abf61f5870", "pins" : [ { "identity" : "bigint", "kind" : "remoteSourceControl", "location" : "https://github.com/attaswift/BigInt", "state" : { - "revision" : "0ed110f7555c34ff468e72e1686e59721f2b0da6", - "version" : "5.3.0" + "revision" : "e07e00fa1fd435143a2dcf8b7eec9a7710b2fdfe", + "version" : "5.7.0" } }, { @@ -37,6 +37,24 @@ "version" : "1.2.1" } }, + { + "identity" : "swift-asn1", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-asn1.git", + "state" : { + "revision" : "40d25bbb2fc5b557a9aa8512210bded327c0f60d", + "version" : "1.5.0" + } + }, + { + "identity" : "swift-async-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-async-algorithms.git", + "state" : { + "revision" : "2773d4125311133a2f705ec374c363a935069d45", + "version" : "1.1.0" + } + }, { "identity" : "swift-atomics", "kind" : "remoteSourceControl", @@ -46,13 +64,31 @@ "version" : "1.3.0" } }, + { + "identity" : "swift-certificates", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-certificates.git", + "state" : { + "revision" : "66a8512c4e7466582bab21e0e0c333f01974e5b6", + "version" : "1.16.0" + } + }, { "identity" : "swift-collections", "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "8c0c0a8b49e080e54e5e328cc552821ff07cd341", - "version" : "1.2.1" + "revision" : "7b847a3b7008b2dc2f47ca3110d8c782fb2e5c7e", + "version" : "1.3.0" + } + }, + { + "identity" : "swift-crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-crypto.git", + "state" : { + "revision" : "6f70fa9eab24c1fd982af18c281c4525d05e3095", + "version" : "4.2.0" } }, { @@ -60,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-http-structured-headers.git", "state" : { - "revision" : "db6eea3692638a65e2124990155cd220c2915903", - "version" : "1.3.0" + "revision" : "76d7627bd88b47bf5a0f8497dd244885960dde0b", + "version" : "1.6.0" } }, { @@ -69,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-http-types.git", "state" : { - "revision" : "a0a57e949a8903563aba4615869310c0ebf14c03", - "version" : "1.4.0" + "revision" : "45eb0224913ea070ec4fba17291b9e7ecf4749ca", + "version" : "1.5.1" } }, { @@ -87,8 +123,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "a5fea865badcb1c993c85b0f0e8d05a4bd2270fb", - "version" : "2.85.0" + "revision" : "3eea09220e07d34ace722221cbda90306f48c86c", + "version" : "2.90.1" } }, { @@ -96,8 +132,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "f1f6f772198bee35d99dd145f1513d8581a54f2c", - "version" : "1.26.0" + "revision" : "7ee281d816fa8e5f3967a2c294035a318ea551c7", + "version" : "1.31.0" } }, { @@ -105,8 +141,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "5e9e99ec96c53bc2c18ddd10c1e25a3cd97c55e5", - "version" : "1.38.0" + "revision" : "c2ba4cfbb83f307c66f5a6df6bb43e3c88dfbf80", + "version" : "1.39.0" } }, { @@ -114,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "385f5bd783ffbfff46b246a7db7be8e4f04c53bd", - "version" : "2.33.0" + "revision" : "173cc69a058623525a58ae6710e2f5727c663793", + "version" : "2.36.0" } }, { @@ -123,8 +159,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "decfd235996bc163b44e10b8a24997a3d2104b90", - "version" : "1.25.0" + "revision" : "60c3e187154421171721c1a38e800b390680fb5d", + "version" : "1.26.0" } }, { @@ -132,8 +168,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-numerics.git", "state" : { - "revision" : "e0ec0f5f3af6f3e4d5e7a19d2af26b481acb6ba8", - "version" : "1.0.3" + "revision" : "0c0290ff6b24942dadb83a929ffaaa1481df04a2", + "version" : "1.1.1" + } + }, + { + "identity" : "swift-service-lifecycle", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/swift-service-lifecycle.git", + "state" : { + "revision" : "1de37290c0ab3c5a96028e0f02911b672fd42348", + "version" : "2.9.1" } }, { @@ -141,8 +186,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "b63d24d465e237966c3f59f47dcac6c70fb0bca3", - "version" : "1.6.1" + "revision" : "395a77f0aa927f0ff73941d7ac35f2b46d47c9db", + "version" : "1.6.3" } }, { diff --git a/Package.swift b/Package.swift index bd4a0e03..5f64d43d 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/attaswift/BigInt", from: "5.3.0"), .package(url: "https://github.com/iwill/generic-json-swift", .upToNextMajor(from: "2.0.2")), - .package(url: "https://github.com/GigaBitcoin/secp256k1.swift.git", .upToNextMajor(from: "0.6.0")), + .package(url: "https://github.com/GigaBitcoin/secp256k1.swift.git", exact: "0.12.2"), .package(url: "https://github.com/vapor/websocket-kit.git", from: "2.16.1"), .package(url: "https://github.com/apple/swift-log.git", from: "1.6.4") ], diff --git a/Package@swift-6.1.swift b/Package@swift-6.1.swift index 7362ba50..9a659fb7 100644 --- a/Package@swift-6.1.swift +++ b/Package@swift-6.1.swift @@ -15,7 +15,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/attaswift/BigInt", from: "5.3.0"), .package(url: "https://github.com/iwill/generic-json-swift", .upToNextMajor(from: "2.0.2")), - .package(url: "https://github.com/GigaBitcoin/secp256k1.swift.git", .upToNextMajor(from: "0.6.0")), + .package(url: "https://github.com/GigaBitcoin/secp256k1.swift.git", exact: "0.12.2"), .package(url: "https://github.com/vapor/websocket-kit.git", from: "2.16.1"), .package(url: "https://github.com/apple/swift-log.git", from: "1.6.4") ], diff --git a/web3swift/src/Extensions/HexExtensions.swift b/web3swift/src/Extensions/HexExtensions.swift index a07537a2..6949517b 100644 --- a/web3swift/src/Extensions/HexExtensions.swift +++ b/web3swift/src/Extensions/HexExtensions.swift @@ -8,7 +8,12 @@ import Foundation public extension BigUInt { init?(hex: String) { - self.init(hex.web3.noHexPrefix.lowercased(), radix: 16) + let stripped = hex.web3.noHexPrefix.lowercased() + if stripped.isEmpty { + self.init(0) + } else { + self.init(stripped, radix: 16) + } } } @@ -24,13 +29,23 @@ public extension Web3Extensions where Base == BigUInt { public extension BigInt { init?(hex: String) { - self.init(hex.web3.noHexPrefix.lowercased(), radix: 16) + let stripped = hex.web3.noHexPrefix.lowercased() + if stripped.isEmpty { + self.init(0) + } else { + self.init(stripped, radix: 16) + } } } public extension Int { init?(hex: String) { - self.init(hex.web3.noHexPrefix, radix: 16) + let stripped = hex.web3.noHexPrefix + if stripped.isEmpty { + self.init(0) + } else { + self.init(stripped, radix: 16) + } } }