Skip to content

Commit dddf1f2

Browse files
Rename getTransactionCount(address:, onBlock:) to getTransactionCount(for:, onBlock:)
1 parent 216686e commit dddf1f2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Sources/web3swift/HookedFunctions/Web3+BrowserFunctions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ extension web3.BrowserFunctions {
195195
case .manual(let nonce):
196196
transaction.nonce = nonce
197197
default:
198-
let nonce = try await self.web3.eth.getTransactionCount(address: from, onBlock: "pending")
198+
let nonce = try await self.web3.eth.getTransactionCount(for: from, onBlock: .pending)
199199
transaction.nonce = nonce
200200
}
201201

Sources/web3swift/Utils/Hooks/NonceMiddleware.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extension Web3.Utils {
3030

3131
knownKeys.forEach { key in
3232
group.addTask {
33-
try? await w3.eth.getTransactionCount(address: key, onBlock: "latest")
33+
try? await w3.eth.getTransactionCount(for: key, onBlock: .latest)
3434
}
3535
}
3636

Sources/web3swift/Web3/Web3+MutatingTransaction.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ public class WriteTransaction: ReadTransaction {
209209
func nonce(for policy: TransactionOptions.NoncePolicy, from: EthereumAddress) async throws -> BigUInt {
210210
switch policy {
211211
case .latest:
212-
return try await self.web3.eth.getTransactionCount(address: from, onBlock: "latest")
212+
return try await self.web3.eth.getTransactionCount(for: from, onBlock: .latest)
213213
case .pending:
214-
return try await self.web3.eth.getTransactionCount(address: from, onBlock: "pending")
214+
return try await self.web3.eth.getTransactionCount(for: from, onBlock: .pending)
215215
case .manual(let nonce):
216216
return nonce
217217
}

0 commit comments

Comments
 (0)