From 56fc498e1bcccbbb5017c2b43b4f83b3260a2744 Mon Sep 17 00:00:00 2001 From: Jenea Vranceanu <36865532+JeneaVranceanu@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:28:42 +0200 Subject: [PATCH] chore: Update Sources/Web3Core/EthereumNetwork/Request/APIRequest+Methods.swift --- .../Web3Core/EthereumNetwork/Request/APIRequest+Methods.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Web3Core/EthereumNetwork/Request/APIRequest+Methods.swift b/Sources/Web3Core/EthereumNetwork/Request/APIRequest+Methods.swift index 6019266d5..95ae1320b 100644 --- a/Sources/Web3Core/EthereumNetwork/Request/APIRequest+Methods.swift +++ b/Sources/Web3Core/EthereumNetwork/Request/APIRequest+Methods.swift @@ -105,8 +105,8 @@ extension APIRequest { return APIResponse(id: 2, result: result) } - /// This bit of code is purposed to work with literal types that come in ``Response`` in hexString type. - /// Currently it's just `Data` and any kind of Integers `(U)Int`, `Big(U)Int`. + /// Checks if `Result` type can be initialized from HEX-encoded bytes. + /// If it can - we attempt initializing a value of `Result` type. if let LiteralType = Result.self as? LiteralInitiableFromString.Type { guard let responseAsString = try? JSONDecoder().decode(APIResponse.self, from: data) else { throw Web3Error.dataError } guard let literalValue = LiteralType.init(from: responseAsString.result) else { throw Web3Error.dataError }