From c9919063be54b382d26d9aadcacfa8a9bce078c0 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:16:27 -0400 Subject: [PATCH 1/5] feat: implement cchecksum for ~2x faster checksumming --- src/ape/managers/converters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ape/managers/converters.py b/src/ape/managers/converters.py index 6fe23788b8..bafb9f65a2 100644 --- a/src/ape/managers/converters.py +++ b/src/ape/managers/converters.py @@ -5,6 +5,7 @@ from functools import cached_property from typing import TYPE_CHECKING, Any, Union +from cchecksum import to_checksum_address from dateutil.parser import parse from eth_pydantic_types import Address, HexBytes from eth_typing.evm import ChecksumAddress @@ -13,7 +14,6 @@ is_checksum_address, is_hex, is_hex_address, - to_checksum_address, to_int, ) From 0faea934cf5a5a6c5bc7634dd2fda599f2bc5346 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:17:10 -0400 Subject: [PATCH 2/5] Update _cli.py --- src/ape_accounts/_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ape_accounts/_cli.py b/src/ape_accounts/_cli.py index f6708a0417..a146d231a2 100644 --- a/src/ape_accounts/_cli.py +++ b/src/ape_accounts/_cli.py @@ -3,7 +3,8 @@ from typing import TYPE_CHECKING, Optional import click -from eth_utils import to_checksum_address, to_hex +from cchecksum import to_checksum_address +from eth_utils import to_hex from ape.cli.arguments import existing_alias_argument, non_existing_alias_argument from ape.cli.options import ape_cli_context From bc4c896044717826ad376b242aa0d51660b44c47 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:17:55 -0400 Subject: [PATCH 3/5] Update ecosystem.py --- src/ape_ethereum/ecosystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ape_ethereum/ecosystem.py b/src/ape_ethereum/ecosystem.py index 86ea1b3d16..115f30e793 100644 --- a/src/ape_ethereum/ecosystem.py +++ b/src/ape_ethereum/ecosystem.py @@ -4,6 +4,7 @@ from functools import cached_property from typing import TYPE_CHECKING, Any, ClassVar, Optional, Union, cast +from cchecksum import to_checksum_address from eth_abi import decode, encode from eth_abi.exceptions import InsufficientDataBytes, NonEmptyPaddingBytes from eth_pydantic_types import HexBytes @@ -17,7 +18,6 @@ is_hex_address, keccak, to_bytes, - to_checksum_address, to_hex, ) from ethpm_types.abi import ABIType, ConstructorABI, EventABI, MethodABI From 4d5300f0d1a8c0019b3ebda3524995c3ff3ade65 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:18:58 -0400 Subject: [PATCH 4/5] Update setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 503c6886fc..1022c5f157 100644 --- a/setup.py +++ b/setup.py @@ -99,6 +99,7 @@ "ipython>=8.18.1,<9", "lazyasd>=0.1.4", "asttokens>=2.4.1,<3", # Peer dependency; w/o pin container build fails. + "cchecksum>=0.0.3,<1", # Pandas peer-dep: Numpy 2.0 causes issues for some users. "numpy<2", "packaging>=23.0,<24", From 16cfd45e0ed787fad507919025a4542da7e8b9f9 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Tue, 10 Dec 2024 09:17:44 -0600 Subject: [PATCH 5/5] chore: lint: --- src/ape/managers/converters.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ape/managers/converters.py b/src/ape/managers/converters.py index bafb9f65a2..3bb2dbb377 100644 --- a/src/ape/managers/converters.py +++ b/src/ape/managers/converters.py @@ -9,13 +9,7 @@ from dateutil.parser import parse from eth_pydantic_types import Address, HexBytes from eth_typing.evm import ChecksumAddress -from eth_utils import ( - is_0x_prefixed, - is_checksum_address, - is_hex, - is_hex_address, - to_int, -) +from eth_utils import is_0x_prefixed, is_checksum_address, is_hex, is_hex_address, to_int from ape.api.address import BaseAddress from ape.api.convert import ConverterAPI