Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: __slots__ #82

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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