From 23b0574af4e6d72b8f8302102e34949913405b51 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Wed, 13 Sep 2023 15:30:16 +0000 Subject: [PATCH 1/2] feat: use __slots__ --- multicall/call.py | 1 + multicall/multicall.py | 2 ++ multicall/signature.py | 1 + 3 files changed, 4 insertions(+) diff --git a/multicall/call.py b/multicall/call.py index 565c87a..600b629 100644 --- a/multicall/call.py +++ b/multicall/call.py @@ -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, diff --git a/multicall/multicall.py b/multicall/multicall.py index c70abeb..c42827f 100644 --- a/multicall/multicall.py +++ b/multicall/multicall.py @@ -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], @@ -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 diff --git a/multicall/signature.py b/multicall/signature.py index f8de537..00d2b14 100644 --- a/multicall/signature.py +++ b/multicall/signature.py @@ -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) From a13c8ff920da472fb276daab056378bb8e25b763 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Wed, 13 Sep 2023 15:40:08 +0000 Subject: [PATCH 2/2] chore: bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6129fb5..a51e386 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]