Skip to content

Commit

Permalink
fix: use new .creation_metadata API
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Sep 20, 2024
1 parent dee4ce7 commit 45dbab5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdk/py/apepay/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,11 @@ def streams_by_creator(self, creator: AddressType) -> Iterator["Stream"]:
yield Stream(manager=self, creator=creator, stream_id=stream_id)

def all_streams(self, start_block: int | None = None) -> Iterator["Stream"]:
if start_block is None and self.contract.creation_metadata:
start_block = self.contract.creation_metadata.block

for stream_created_event in self.contract.StreamCreated.range(
start_block if start_block is not None else self.contract.receipt.block_number,
start_block or 0,
self.chain_manager.blocks.head.number,
):
yield Stream.from_event(
Expand Down

0 comments on commit 45dbab5

Please sign in to comment.