Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Aug 8, 2022
1 parent fee7959 commit a81f058
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion checksum_dict/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ def _setitem_nochecksum(self, key: EthAddressKey, value: T) -> None:
"""
if not key.startswith("0x") or len(key) != 42:
raise ValueError(f"'{key}' is not a valid ETH address")
return super().__setitem__(key, value)
dict.__setitem__(key, value)
8 changes: 0 additions & 8 deletions checksum_dict/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,3 @@ def _getitem_nochecksum(self, key: EthAddressKey) -> T:
default = self.default_factory() # type: ignore
self._setitem_nochecksum(key, default)
return default

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.
"""
if not key.startswith("0x") or len(key) != 42:
raise ValueError(f"'{key}' is not a valid ETH address")
dict.__setitem__(self, key, value)

0 comments on commit a81f058

Please sign in to comment.