Skip to content

Commit d6ed5c9

Browse files
committed
fix
1 parent cc76535 commit d6ed5c9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

faster_web3/middleware/formatting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def _format_response(
6767
appropriate_response = cast(EthSubscriptionParams, response[response_type])
6868
params = response["params"].copy()
6969
params["result"] = method_response_formatter(appropriate_response["result"])
70-
response = response.copy()
7170
response[response_type] = params
7271
else:
7372
response[response_type] = method_response_formatter(appropriate_response)

faster_web3/providers/eth_tester/middleware.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,10 @@ def guess_from(w3: "Web3", _: TxParams) -> ChecksumAddress:
372372
def fill_default(
373373
field: str, guess_func: Callable[..., Any], w3: "Web3", transaction: TxParams
374374
) -> TxParams:
375-
if field not in transaction or transaction[field] is None:
375+
if transaction.get(field) is None:
376376
guess_val = guess_func(w3, transaction)
377377
transaction = transaction.copy()
378-
transaction[field] = guess_val
378+
transaction[field] = guess_val # type: ignore [literal-required]
379379
return transaction
380380

381381

@@ -396,10 +396,10 @@ async def async_fill_default(
396396
async_w3: "AsyncWeb3[Any]",
397397
transaction: TxParams,
398398
) -> TxParams:
399-
if field not in transaction or transaction[field] is None:
399+
if transaction.get(field) is None:
400400
guess_val = await guess_func(async_w3, transaction)
401401
transaction = transaction.copy()
402-
transaction[field] = guess_val
402+
transaction[field] = guess_val # type: ignore [literal-required]
403403
return transaction
404404

405405

0 commit comments

Comments
 (0)