Skip to content

Commit 0127132

Browse files
committed
fix bug
1 parent bcebcb0 commit 0127132

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/web3swift/EthereumAPICalls/Ethereum/Eth+SendRawTransaction.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import Core
99

1010
extension Web3.Eth {
1111
public func send(raw data: Data) async throws -> TransactionSendingResult {
12-
guard let hexString = String(data: data, encoding: .utf8)?.addHexPrefix() else { throw Web3Error.dataError }
12+
let hexString = data.toHexString().addHexPrefix()
13+
1314
let request: APIRequest = .sendRawTransaction(hexString)
1415
let response: APIResponse<Hash> = try await APIRequest.sendRequest(with: self.provider, for: request)
1516
return try TransactionSendingResult(data: data, hash: response.result)

0 commit comments

Comments
 (0)