Skip to content

contract.call() block_identifier default change #2335

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

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 3 additions & 1 deletion web3/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def _set_function_info(self) -> None:

def call(
self, transaction: Optional[TxParams] = None,
block_identifier: BlockIdentifier = 'latest',
block_identifier: BlockIdentifier = None,
state_override: Optional[CallOverrideParams] = None,
) -> Any:
"""
Expand Down Expand Up @@ -1542,6 +1542,8 @@ def call_contract_function(


def parse_block_identifier(web3: 'Web3', block_identifier: BlockIdentifier) -> BlockIdentifier:
if block_identifier is None:
return web3.eth.default_block
if isinstance(block_identifier, int):
return parse_block_identifier_int(web3, block_identifier)
elif block_identifier in ['latest', 'earliest', 'pending']:
Expand Down