Skip to content

Commit

Permalink
test: fix test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
darwintree committed Nov 4, 2024
1 parent a16fa9b commit 01b1b39
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion conflux_web3/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ def get_logs(self, filter_params: FilterParams) -> List[LogReceipt]:...
@overload
def get_logs(self, filter_params: None=None, **kwargs: Any) -> List[LogReceipt]:...

def get_logs(self, filter_params: Optional[FilterParams]=None, **kwargs: Any) -> List[LogReceipt]:
def get_logs(self, filter_params: Optional[FilterParams]=None, **kwargs: Optional[FilterParams]) -> List[LogReceipt]:
"""
Returns logs matching the filter provided.
It is accepted to pass filter_params as a dict or by direclty specifying field name (but cannot mix)
Expand Down
4 changes: 3 additions & 1 deletion tests/middleware/test_pending.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import pytest
from typing import TYPE_CHECKING
from cfx_account.account import LocalAccount

Expand Down Expand Up @@ -33,4 +34,5 @@ def test_pending(w3: "Web3", account: LocalAccount, use_testnet: bool):
pending.executed()
pending.confirmed()
if use_testnet and os.environ.get("TEST_FINALIZATION", None):
pending.finalized()
with pytest.raises(UserWarning):
pending.finalized()
7 changes: 2 additions & 5 deletions tests/transaction/test_contract.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from typing import TYPE_CHECKING
import os, json, pytest
import pytest

from hexbytes import HexBytes

from eth_utils.exceptions import ValidationError

from conflux_web3 import Web3
from conflux_web3.contract import (
Expand Down Expand Up @@ -63,7 +60,7 @@ def test_contract_deploy_and_transfer(self, w3_: Web3):

# test getLogs
from_epoch = transfer_receipt["epochNumber"]
logs = w3_.cfx.get_logs(from_epoch=from_epoch, address=contract_address)
logs = w3_.cfx.get_logs(fromEpoch=from_epoch, address=contract_address)
for log in logs:
TypeValidator.validate_typed_dict(log, "LogReceipt")

Expand Down

0 comments on commit 01b1b39

Please sign in to comment.