Skip to content

Commit

Permalink
Fix 'create_contract_deployment' condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kkawula committed Aug 29, 2024
1 parent b315707 commit 553fb8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions starknet_py/net/udc_deployer/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def create_contract_deployment(
"Argument calldata was provided without an ABI. It cannot be serialized."
)
raw_calldata = [int_from_hex(x) for x in calldata]

elif calldata and abi:
elif calldata and abi is not None:
raw_calldata = translate_constructor_args(
abi=abi or [], constructor_args=calldata, cairo_version=cairo_version
)
Expand Down
6 changes: 1 addition & 5 deletions starknet_py/tests/e2e/deploy/deployer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ async def test_constructor_arguments_contract_deploy_without_abi(
deploy_call, contract_address = deployer.create_contract_deployment(
class_hash=constructor_with_arguments_class_hash,
calldata=calldata,
cairo_version=1,
)

deploy_invoke_transaction = await account.sign_invoke_v1(
Expand Down Expand Up @@ -93,7 +92,6 @@ async def test_constructor_arguments_contract_deploy(
class_hash=constructor_with_arguments_class_hash,
abi=constructor_with_arguments_abi,
calldata=calldata,
cairo_version=1,
)

deploy_invoke_transaction = await account.sign_invoke_v1(
Expand All @@ -106,7 +104,6 @@ async def test_constructor_arguments_contract_deploy(
address=contract_address,
abi=constructor_with_arguments_abi,
provider=account,
cairo_version=1,
)

result = (await contract.functions["get"].call(block_number="latest"))[0]
Expand Down Expand Up @@ -205,7 +202,7 @@ async def test_create_deployment_call_raw(
deployer = Deployer(account_address=account.address)

raw_calldata = translate_constructor_args(
abi=constructor_with_arguments_abi, constructor_args=calldata, cairo_version=1
abi=constructor_with_arguments_abi, constructor_args=calldata
)

(
Expand Down Expand Up @@ -248,7 +245,6 @@ async def test_create_deployment_call_raw_supports_seed_0(
raw_calldata = translate_constructor_args(
abi=constructor_with_arguments_abi,
constructor_args=sample_calldata,
cairo_version=1,
)

expected_address = compute_address(
Expand Down

0 comments on commit 553fb8b

Please sign in to comment.