cchecksum 0.3.0__cp311-cp311-win32.whl → 0.3.1__cp311-cp311-win32.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cchecksum might be problematic. Click here for more details.

cchecksum/__init__.py CHANGED
@@ -5,5 +5,7 @@ It keeps the exact same API as the existing implementation, exceptions and all.
5
5
  """
6
6
 
7
7
  from cchecksum._checksum import to_checksum_address
8
+ from cchecksum.monkey_patch import monkey_patch_eth_utils, monkey_patch_web3py
8
9
 
9
- __all__ = ["to_checksum_address"]
10
+
11
+ __all__ = ["to_checksum_address", "monkey_patch_eth_utils", "monkey_patch_web3py"]
Binary file
@@ -0,0 +1,47 @@
1
+ from cchecksum._checksum import to_checksum_address
2
+
3
+
4
+ def monkey_patch_eth_utils() -> None:
5
+ """Monkey patch eth_utils to use cchecksum's implementation internally."""
6
+ import eth_utils
7
+ import eth_utils.address
8
+
9
+ eth_utils.to_checksum_address = to_checksum_address
10
+ eth_utils.address.to_checksum_address = to_checksum_address
11
+
12
+
13
+ def monkey_patch_web3py() -> None:
14
+ """Monkey patch web3.py to use cchecksum's implementation internally."""
15
+ import web3._utils as web3_utils
16
+ import web3.main as web3_main
17
+ import web3.middleware as web3_middleware
18
+
19
+ web3_main.to_checksum_address = to_checksum_address
20
+ web3_utils.ens.to_checksum_address = to_checksum_address
21
+ web3_utils.method_formatters.to_checksum_address = to_checksum_address
22
+ web3_utils.normalizers.to_checksum_address = to_checksum_address
23
+ web3_middleware.signing.to_checksum_address = to_checksum_address
24
+
25
+ try:
26
+ import web3.utils.address as web3_address
27
+
28
+ web3_address.to_checksum_address = to_checksum_address
29
+ except ModuleNotFoundError:
30
+ # youre on an older web3py, no monkey patch for you
31
+ pass
32
+
33
+ try:
34
+ import ens.ens
35
+
36
+ ens.ens.to_checksum_address = to_checksum_address
37
+ except ModuleNotFoundError:
38
+ # youre on an older web3py, no monkey patch for you
39
+ pass
40
+
41
+ try:
42
+ import ens.async_ens
43
+
44
+ ens.async_ens.to_checksum_address = to_checksum_address
45
+ except ModuleNotFoundError:
46
+ # youre on an older web3py, no monkey patch for you
47
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cchecksum
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: A ~8x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
5
5
  Home-page: https://github.com/BobTheBuidler/cchecksum
6
6
  Author: BobTheBuidler
@@ -0,0 +1,12 @@
1
+ cchecksum/__init__.py,sha256=-Kr6qCmi2w8Mzy5TGFJgZIGcxFGY19uTw4HJbkK8duE,448
2
+ cchecksum/_checksum.c,sha256=lzSr-r6S07cUwO5scF0zeOzhLfBdbRVDwtzO4Ao1cN0,1205214
3
+ cchecksum/_checksum.cp311-win32.pyd,sha256=q09wCc1i-efF9ff6Rv3KprUbt2CtP8M6e0CTcogeAc8,123392
4
+ cchecksum/_checksum.pyi,sha256=eUGDp_H5_OOvDRL0GJRekMDSXSPxGwhPo9WKLCpIz3Q,2377
5
+ cchecksum/_checksum.pyx,sha256=ukYP-Klj5pnVZu015h9gZqTBwW2bfFvo0RRJMIcAfXw,16125
6
+ cchecksum/monkey_patch.py,sha256=rEGkjNKS0gLnmg9K5cB2xf9LDZgs9_M9wf8mggAq4_Q,1587
7
+ cchecksum/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ cchecksum-0.3.1.dist-info/licenses/LICENSE,sha256=fQVwsRjteeLx97IRvfK64JDaGcNv1BN4_SvhXX0Zemo,1091
9
+ cchecksum-0.3.1.dist-info/METADATA,sha256=oASB5Hj--vwoQcTQeRQqgjAvumvoP-F1bmKL-UrTWf4,1216
10
+ cchecksum-0.3.1.dist-info/WHEEL,sha256=Ri8zddKrjGdgjlj1OpSsvpDnvHfnQhMQWi3E_v2pqng,97
11
+ cchecksum-0.3.1.dist-info/top_level.txt,sha256=Qm8-fG-PzUlKgrtwwH508kIYkP63C2tRYA1qePeqAZQ,10
12
+ cchecksum-0.3.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-win32
5
5
 
@@ -1,11 +0,0 @@
1
- cchecksum/__init__.py,sha256=LpElEhZx7qv5zPz73Fn5M6ITGXkgdFXRbQqNNTtnL08,317
2
- cchecksum/_checksum.c,sha256=lzSr-r6S07cUwO5scF0zeOzhLfBdbRVDwtzO4Ao1cN0,1205214
3
- cchecksum/_checksum.cp311-win32.pyd,sha256=mSsY66FWVR3U4NoMRNbmjuk1iaLg3pifAb8EGSXCXIw,123392
4
- cchecksum/_checksum.pyi,sha256=eUGDp_H5_OOvDRL0GJRekMDSXSPxGwhPo9WKLCpIz3Q,2377
5
- cchecksum/_checksum.pyx,sha256=ukYP-Klj5pnVZu015h9gZqTBwW2bfFvo0RRJMIcAfXw,16125
6
- cchecksum/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- cchecksum-0.3.0.dist-info/licenses/LICENSE,sha256=fQVwsRjteeLx97IRvfK64JDaGcNv1BN4_SvhXX0Zemo,1091
8
- cchecksum-0.3.0.dist-info/METADATA,sha256=Qh-EhOWlSylpPZRgqvjErBMx16AL-1byDLpm3r5je0Q,1216
9
- cchecksum-0.3.0.dist-info/WHEEL,sha256=uEHM8qsHoPBpfQcpB4pVEIwlIRfb-c69p6fzj7yGRxw,97
10
- cchecksum-0.3.0.dist-info/top_level.txt,sha256=Qm8-fG-PzUlKgrtwwH508kIYkP63C2tRYA1qePeqAZQ,10
11
- cchecksum-0.3.0.dist-info/RECORD,,