From 8d19725f90f7408f7e65a17b91f380edbf5f874b Mon Sep 17 00:00:00 2001 From: antazoey Date: Thu, 4 Jan 2024 10:37:39 -0600 Subject: [PATCH] test: show that `get_deployment_bytecode` and alike function (#112) --- tests/test_contract_type.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_contract_type.py b/tests/test_contract_type.py index 3d79f2f..75e48f1 100644 --- a/tests/test_contract_type.py +++ b/tests/test_contract_type.py @@ -349,3 +349,25 @@ def test_identifier_lookup(vyper_contract): ].selector == "FooHappened(uint256)" ) + + +def test_get_runtime_bytecode(vyper_contract): + actual = vyper_contract.get_runtime_bytecode() + assert actual.hex().startswith("0x") + + +def test_get_runtime_bytecode_no_code(vyper_contract): + vyper_contract.runtime_bytecode = None + actual = vyper_contract.get_runtime_bytecode() + assert actual is None + + +def test_get_deployment_bytecode(vyper_contract): + actual = vyper_contract.get_deployment_bytecode() + assert actual.hex().startswith("0x") + + +def test_get_deployment_bytecode_no_code(vyper_contract): + vyper_contract.deployment_bytecode = None + actual = vyper_contract.get_deployment_bytecode() + assert actual is None