Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Elnaril committed Dec 26, 2023
1 parent 31091d8 commit ab53c80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/test_router_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_build_abi_map(command_id, expected_fct_abi, expected_selector):
expected_function_names_05 = (None, None)

trx_hash_09 = HexStr("0x2b6af8ef8fe18829a0fcf2b0f391c55daf76f53bb68369ecaefdb1f38045f919")
expected_function_names_09 = ("PERMIT2_PERMIT", "V2_SWAP_EXACT_IN", "V2_SWAP_EXACT_IN", "V3_SWAP_EXACT_IN", "V2_SWAP_EXACT_IN", "V3_SWAP_EXACT_IN", None)
expected_function_names_09 = ("PERMIT2_PERMIT", "V2_SWAP_EXACT_IN", "V2_SWAP_EXACT_IN", "V3_SWAP_EXACT_IN", "V2_SWAP_EXACT_IN", "V3_SWAP_EXACT_IN", None) # noqa


@pytest.mark.parametrize(
Expand All @@ -80,7 +80,7 @@ def test_decode_transaction(trx_hash, w3, rpc_endpoint, expected_fct_names):
if expected_name:
assert expected_name == command_inputs[i][0].fn_name
else:
assert type(command_inputs[i]) == str
assert type(command_inputs[i]) is str
int(command_inputs[i], 16) # check the str is actually a hex


Expand Down
2 changes: 1 addition & 1 deletion uniswap_universal_router_decoder/router_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def decode_v3_path(v3_fn_name: str, path: Union[bytes, str]) -> Tuple[Union[int,
valid_fn_names = ("V3_SWAP_EXACT_IN", "V3_SWAP_EXACT_OUT")
if v3_fn_name.upper() not in valid_fn_names:
raise ValueError(f"v3_fn_name must be in {valid_fn_names}")
path_str = path.hex() if type(path) == bytes else str(path)
path_str = path.hex() if isinstance(path, bytes) else str(path)
path_str = path_str[2:] if path_str.startswith("0x") else path_str
path_list: List[Union[int, ChecksumAddress]] = [Web3.toChecksumAddress(path_str[0:40]), ]
parsed_remaining_path: List[List[Union[int, ChecksumAddress]]] = [
Expand Down

0 comments on commit ab53c80

Please sign in to comment.