diff --git a/src/ape/api/providers.py b/src/ape/api/providers.py index 09f93cdc0f..c0d6235d7b 100644 --- a/src/ape/api/providers.py +++ b/src/ape/api/providers.py @@ -1535,9 +1535,9 @@ def poll_logs( required_confirmations: Optional[int] = None, new_block_timeout: Optional[int] = None, ) -> Iterator[ContractLog]: - required_confirmations = ( - required_confirmations or self.provider.network.required_confirmations - ) + if required_confirmations is None: + required_confirmations = self.network.required_confirmations + for block in self.poll_blocks(stop_block, required_confirmations, new_block_timeout): if block.number is None: raise ValueError("Block number cannot be None") diff --git a/src/ape/contracts/base.py b/src/ape/contracts/base.py index 55e40d6e10..fe5e3b41aa 100644 --- a/src/ape/contracts/base.py +++ b/src/ape/contracts/base.py @@ -688,9 +688,8 @@ def poll_logs( Iterator[:class:`~ape.types.ContractLog`] """ - required_confirmations = ( - required_confirmations or self.provider.network.required_confirmations - ) + if required_confirmations is None: + required_confirmations = self.provider.network.required_confirmations # NOTE: We process historical blocks separately here to minimize rpc calls height = max(self.chain_manager.blocks.height - required_confirmations, 0) diff --git a/src/ape/managers/chain.py b/src/ape/managers/chain.py index e0dbc00ecf..3a58e2ec82 100644 --- a/src/ape/managers/chain.py +++ b/src/ape/managers/chain.py @@ -269,6 +269,7 @@ def poll_blocks( Returns: Iterator[:class:`~ape.api.providers.BlockAPI`] """ + if required_confirmations is None: required_confirmations = self.network_confirmations