From 4bc7dd6bc0c331431b6e95a60d77b25cc979bfc9 Mon Sep 17 00:00:00 2001 From: Forrest Date: Thu, 27 Oct 2022 12:18:06 +0800 Subject: [PATCH] fix --- Sources/AptosSwift/AptosAddress.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/AptosSwift/AptosAddress.swift b/Sources/AptosSwift/AptosAddress.swift index f13bd1c..b006a62 100644 --- a/Sources/AptosSwift/AptosAddress.swift +++ b/Sources/AptosSwift/AptosAddress.swift @@ -27,7 +27,7 @@ public struct AptosAddress: CustomStringConvertible { } public init(_ address: String) throws { - guard address.isHex() else { + guard address.hasPrefix("0x"), address.isHex() else { throw AptosError.keyError("Invalid address string. \(address)") } let hex = address.stripHexPrefix()