Skip to content

Commit

Permalink
feat: implement cchecksum for ~2x faster checksumming (#2404)
Browse files Browse the repository at this point in the history
Co-authored-by: Juliya Smith <[email protected]>
  • Loading branch information
BobTheBuidler and antazoey authored Dec 10, 2024
1 parent be5be1c commit a3f17aa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 2 additions & 8 deletions src/ape/managers/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@
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
from eth_utils import (
is_0x_prefixed,
is_checksum_address,
is_hex,
is_hex_address,
to_checksum_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
Expand Down
3 changes: 2 additions & 1 deletion src/ape_accounts/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ape_ethereum/ecosystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,7 +18,6 @@
is_hex_address,
keccak,
to_bytes,
to_checksum_address,
to_hex,
)
from ethpm_types.abi import ABIType, ConstructorABI, EventABI, MethodABI
Expand Down

0 comments on commit a3f17aa

Please sign in to comment.