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 {
107
107
if let ethAddress = EthereumAddress ( string) {
108
108
return ethAddress. address
109
109
}
110
- if let url = URL ( string: string) {
110
+ if URL ( string: string) != nil {
111
111
return string
112
112
}
113
113
}
@@ -163,7 +163,7 @@ extension Web3 {
163
163
return Data ( bytes) . toHexString ( ) . addHexPrefix ( )
164
164
} else if let string = rawValue as? String {
165
165
if let bytes = Data . fromHex ( string) {
166
- return string . addHexPrefix ( )
166
+ return bytes . toHexString ( ) . addHexPrefix ( )
167
167
}
168
168
return string. data ( using: . utf8) ? . toHexString ( ) . addHexPrefix ( )
169
169
}
@@ -177,8 +177,9 @@ extension Web3 {
177
177
} else if let string = rawValue as? String {
178
178
if let bytes = Data . fromHex ( string) {
179
179
data = bytes
180
+ } else {
181
+ data = string. data ( using: . utf8)
180
182
}
181
- data = string. data ( using: . utf8)
182
183
}
183
184
184
185
if let data = data,
You can’t perform that action at this time.
0 commit comments