Skip to content

Commit fbc1c1d

Browse files
committed
supports overwriting pending txns that use the same nonce
1 parent a77d1aa commit fbc1c1d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cheb3/account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def send_transaction(
106106
"from": self.address,
107107
"to": to,
108108
"chainId": self.w3.eth.chain_id,
109-
"nonce": self.w3.eth.get_transaction_count(self.address),
109+
"nonce": kwargs.get("nonce", self.w3.eth.get_transaction_count(self.address)),
110110
"value": value,
111111
"gasPrice": kwargs.get("gas_price", self.w3.eth.gas_price),
112112
"data": data,

cheb3/contract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def send_transaction(self, **kwargs) -> TxReceipt:
229229
estimate_gas = 3000000
230230
tx = {
231231
"chainId": self.w3.eth.chain_id,
232-
"nonce": self.w3.eth.get_transaction_count(self.signer.address),
232+
"nonce": kwargs.get("nonce", self.w3.eth.get_transaction_count(self.signer.address)),
233233
"gasPrice": kwargs.get("gas_price", self.w3.eth.gas_price),
234234
"value": kwargs.get("value", 0),
235235
"gas": kwargs.get("gas_limit", estimate_gas),

0 commit comments

Comments
 (0)