From 94738d0d00306fc80b86482e80240d58aa059d99 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Sun, 7 Aug 2022 21:42:40 +0000 Subject: [PATCH] feat: internal methods for bypassing checksum in custom subclasses --- checksum_dict/base.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/checksum_dict/base.py b/checksum_dict/base.py index 255d454..12d8311 100644 --- a/checksum_dict/base.py +++ b/checksum_dict/base.py @@ -43,3 +43,15 @@ def __setitem__(self, key: AnyAddressOrContract, value: T) -> None: super().__setitem__(key, value) else: super().__setitem__(EthAddressKey(key), value) + + def __getitem_nochecksum(self, key: EthAddressKey) -> T: + """ + You can use this method in custom subclasses to bypass the checksum ONLY if you know its already been done at an earlier point in your code. + """ + return super().__getitem__(key) + + def __setitem_nochecksum(self, key: EthAddressKey, value: T) -> None: + """ + You can use this method in custom subclasses to bypass the checksum ONLY if you know its already been done at an earlier point in your code. + """ + return super().__setitem__(key, value)