File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Sources/web3swift/Utils/EIP Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ extension Web3 {
107107 if let ethAddress = EthereumAddress ( string) {
108108 return ethAddress. address
109109 }
110- if let url = URL ( string: string) {
110+ if URL ( string: string) != nil {
111111 return string
112112 }
113113 }
@@ -163,7 +163,7 @@ extension Web3 {
163163 return Data ( bytes) . toHexString ( ) . addHexPrefix ( )
164164 } else if let string = rawValue as? String {
165165 if let bytes = Data . fromHex ( string) {
166- return string . addHexPrefix ( )
166+ return bytes . toHexString ( ) . addHexPrefix ( )
167167 }
168168 return string. data ( using: . utf8) ? . toHexString ( ) . addHexPrefix ( )
169169 }
@@ -177,8 +177,9 @@ extension Web3 {
177177 } else if let string = rawValue as? String {
178178 if let bytes = Data . fromHex ( string) {
179179 data = bytes
180+ } else {
181+ data = string. data ( using: . utf8)
180182 }
181- data = string. data ( using: . utf8)
182183 }
183184
184185 if let data = data,
You can’t perform that action at this time.
0 commit comments