starkware-libs / cairo-lang

Apache License 2.0
1.33k stars 262 forks source link

[Minor] Outdated `StarknetContract` docstring #76

Open Pet3ris opened 2 years ago

Pet3ris commented 2 years ago

I think this docstring example creation is outdated as it is missing the deploy_execution_info argument: https://github.com/starkware-libs/cairo-lang/blob/167b28bcd940fd25ea3816204fa882a0b0a49603/src/starkware/starknet/testing/contract.py#L45

Cevedale commented 9 months ago

The docstring example was indeed incomplete, and I appreciate your keen observation. I've updated it to include the deploy_execution_info argument in the instantiation example, ensuring a more accurate and comprehensive representation of the class usage.

class StarknetContract: """ A high level interface to a StarkNet contract used for testing. Allows invoking functions. Example: contract_class = compile_starknet_files(...) state = await StarknetState.empty() contract_address = await state.deploy(contract_class=contract_class) deploy_execution_info = ... # Obtain the deployment transaction execution info. contract = StarknetContract( state=state, abi=contract_class.abi, contract_address=contract_address, deploy_execution_info=deploy_execution_info)

  await contract.foo(a=1, b=[2, 3]).invoke()
"""
# ... (rest of the class remains unchanged)