Skip to content

Commit 93e8d52

Browse files
fix: removed previously added overloaded functions that accept hashes as String
1 parent f001cec commit 93e8d52

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import Core
99

1010
extension Web3.Eth {
1111
public func transactionDetails(_ txHash: Data) async throws -> TransactionDetails {
12-
try await transactionDetails(txHash.toHexString().addHexPrefix())
13-
}
14-
15-
public func transactionDetails(_ txHash: String) async throws -> TransactionDetails {
16-
try await APIRequest.sendRequest(with: self.provider, for: .getTransactionByHash(txHash)).result
12+
try await APIRequest.sendRequest(with: self.provider,
13+
for: .getTransactionByHash(txHash.toHexString().addHexPrefix())).result
1714
}
1815
}

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import Core
99

1010
extension Web3.Eth {
1111
public func transactionReceipt(_ txHash: Data) async throws -> TransactionReceipt {
12-
try await transactionReceipt(txHash.toHexString().addHexPrefix())
13-
}
14-
15-
public func transactionReceipt(_ txHash: String) async throws -> TransactionReceipt {
1612
try await APIRequest.sendRequest(with: self.provider,
17-
for: .getTransactionReceipt(txHash)).result
13+
for: .getTransactionReceipt(txHash.toHexString().addHexPrefix())).result
1814
}
1915
}

Tests/web3swiftTests/localTests/BasicLocalNodeTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class BasicLocalNodeTests: LocalTestCase {
6666
print("Balance before from: " + balanceBeforeFrom.description)
6767

6868
let result = try! await sendTx.writeToChain(password: "web3swift")
69-
let txHash = result.hash
69+
let txHash = Data.fromHex(result.hash.stripHexPrefix())!
7070

7171
Thread.sleep(forTimeInterval: 1.0)
7272

0 commit comments

Comments
 (0)