Skip to content

Commit

Permalink
feat: __slots__ (#82)
Browse files Browse the repository at this point in the history
* feat: use __slots__

* chore: bump version
  • Loading branch information
BobTheBuidler authored Sep 13, 2023
1 parent 3bb2ae5 commit b658995
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions multicall/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
AnyAddress = Union[str,Address,ChecksumAddress,HexAddress]

class Call:
__slots__ = "target", "returns", "block_id", "gas_limit", "state_override_code", "w3", "args", "function", "signature"
def __init__(
self,
target: AnyAddress,
Expand Down
2 changes: 2 additions & 0 deletions multicall/multicall.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def unpack_batch_results(batch_results: List[List[CallResponse]]) -> List[CallRe


class Multicall:
__slots__ = "calls", "block_id", "require_success", "gas_limit", "w3", "chainid", "multicall_sig", "multicall_address"
def __init__(
self,
calls: List[Call],
Expand Down Expand Up @@ -138,6 +139,7 @@ class NotSoBrightBatcher:
This class helps with processing a large volume of large multicalls.
It's not so bright, but should quickly bring the batch size down to something reasonable for your node.
"""
__slots__ = "step",
def __init__(self) -> None:
self.step = 10000

Expand Down
1 change: 1 addition & 0 deletions multicall/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def parse_typestring(typestring: str) -> Optional[List[TypeStr]]:


class Signature:
__slots__ = "signature", "function", "input_types", "output_types"
def __init__(self, signature: str) -> None:
self.signature = signature
self.function, self.input_types, self.output_types = parse_signature(signature)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "multicall"
version = "0.7.5"
version = "0.7.6"
description = "aggregate results from multiple ethereum contract calls"
authors = ["banteg"]

Expand Down

0 comments on commit b658995

Please sign in to comment.