From 4d5a1306c5f8fcf95d91ad8813c9957b3444fa2c Mon Sep 17 00:00:00 2001 From: lin Date: Thu, 22 Sep 2022 11:51:16 +0900 Subject: [PATCH 1/2] Test/Tezt: Add tezt test for create contract --- .../proto_alpha/originate_contract.tz | 14 +++ tezt/tests/create_contract.ml | 65 +++++++++++ .../Alpha- Create contract.out | 109 ++++++++++++++++++ .../Jakarta- Create contract.out | 109 ++++++++++++++++++ .../Kathmandu- Create contract.out | 109 ++++++++++++++++++ tezt/tests/main.ml | 1 + 6 files changed, 407 insertions(+) create mode 100644 tezt/tests/contracts/proto_alpha/originate_contract.tz create mode 100644 tezt/tests/create_contract.ml create mode 100644 tezt/tests/expected/create_contract.ml/Alpha- Create contract.out create mode 100644 tezt/tests/expected/create_contract.ml/Jakarta- Create contract.out create mode 100644 tezt/tests/expected/create_contract.ml/Kathmandu- Create contract.out diff --git a/tezt/tests/contracts/proto_alpha/originate_contract.tz b/tezt/tests/contracts/proto_alpha/originate_contract.tz new file mode 100644 index 000000000000..473143da42f5 --- /dev/null +++ b/tezt/tests/contracts/proto_alpha/originate_contract.tz @@ -0,0 +1,14 @@ +parameter unit; +storage unit; +code { DROP; + UNIT; + AMOUNT; + NONE key_hash; + CREATE_CONTRACT + { parameter unit ; + storage unit ; + code + { CDR; + NIL operation; + PAIR; } }; + DIP {DROP; PUSH unit Unit; NIL operation};CONS ; PAIR} diff --git a/tezt/tests/create_contract.ml b/tezt/tests/create_contract.ml new file mode 100644 index 000000000000..c1f576ef37e3 --- /dev/null +++ b/tezt/tests/create_contract.ml @@ -0,0 +1,65 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2022 Marigold *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +(* Testing + ------- + Component: Michelson + Invocation: dune exec tezt/tests/main.exe -- --file create_contract.ml + Subject: Regression tests for contract that creates a contract +*) + +let hooks = Tezos_regression.hooks + +let test_call_contract_that_creates_contract = + Protocol.register_regression_test + ~__FILE__ + ~title:"Create contract" + ~tags:["client"; "michelson"] + @@ fun protocol -> + let* client = Client.init_mockup ~protocol () in + let* contract_id = + Client.originate_contract + ~alias:"originate_contract.tz" + ~amount:(Tez.of_int 200) + ~src:"bootstrap1" + ~prg:"file:./tezt/tests/contracts/proto_alpha/originate_contract.tz" + ~init:"Unit" + ~burn_cap:Tez.one + ~hooks + client + in + let* () = + Client.transfer + ~amount:Tez.one + ~arg:"Unit" + ~burn_cap:(Tez.of_int 2) + ~giver:"bootstrap2" + ~receiver:contract_id + ~hooks + client + in + unit + +let register ~protocols = test_call_contract_that_creates_contract protocols diff --git a/tezt/tests/expected/create_contract.ml/Alpha- Create contract.out b/tezt/tests/expected/create_contract.ml/Alpha- Create contract.out new file mode 100644 index 000000000000..c3e1fbcb1a07 --- /dev/null +++ b/tezt/tests/expected/create_contract.ml/Alpha- Create contract.out @@ -0,0 +1,109 @@ + +./tezos-client --mode mockup --wait none originate contract originate_contract.tz transferring 200 from bootstrap1 running file:./tezt/tests/contracts/proto_alpha/originate_contract.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1428.637 units (will add 100 for safety) +Estimated storage: 350 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000476 + Expected counter: 1 + Gas limit: 1529 + Storage limit: 370 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000476 + payload fees(the block proposer) ....... +ꜩ0.000476 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ200 + Script: + { parameter unit ; + storage unit ; + code { DROP ; + UNIT ; + AMOUNT ; + NONE key_hash ; + CREATE_CONTRACT + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } ; + DIP { DROP ; PUSH unit Unit ; NIL operation } ; + CONS ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 93 bytes + Paid storage size diff: 93 bytes + Consumed gas: 1428.637 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.02325 + storage fees ........................... +ꜩ0.02325 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ200 + [CONTRACT_HASH] ... +ꜩ200 + +New contract [CONTRACT_HASH] originated. +Contract memorized as originate_contract.tz. + +./tezos-client --mode mockup --wait none transfer 1 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --arg Unit +Node is bootstrapped. +Estimated gas: 3525.357 units (will add 100 for safety) +Estimated storage: 295 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000614 + Expected counter: 1 + Gas limit: 3626 + Storage limit: 315 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000614 + payload fees(the block proposer) ....... +ꜩ0.000614 + Transaction: + Amount: ꜩ1 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: Unit + Storage size: 93 bytes + Consumed gas: 2120.735 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + Internal operations: + Internal Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1 + Script: + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 38 bytes + Paid storage size diff: 38 bytes + Consumed gas: 1405.267 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0095 + storage fees ........................... +ꜩ0.0095 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + +New contract [CONTRACT_HASH] originated. diff --git a/tezt/tests/expected/create_contract.ml/Jakarta- Create contract.out b/tezt/tests/expected/create_contract.ml/Jakarta- Create contract.out new file mode 100644 index 000000000000..e13d90ff1cd4 --- /dev/null +++ b/tezt/tests/expected/create_contract.ml/Jakarta- Create contract.out @@ -0,0 +1,109 @@ + +./tezos-client --mode mockup --wait none originate contract originate_contract.tz transferring 200 from bootstrap1 running file:./tezt/tests/contracts/proto_alpha/originate_contract.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1425.542 units (will add 100 for safety) +Estimated storage: 350 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000476 + Expected counter: 1 + Gas limit: 1526 + Storage limit: 370 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000476 + payload fees(the block proposer) ....... +ꜩ0.000476 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ200 + Script: + { parameter unit ; + storage unit ; + code { DROP ; + UNIT ; + AMOUNT ; + NONE key_hash ; + CREATE_CONTRACT + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } ; + DIP { DROP ; PUSH unit Unit ; NIL operation } ; + CONS ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 93 bytes + Paid storage size diff: 93 bytes + Consumed gas: 1425.542 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.02325 + storage fees ........................... +ꜩ0.02325 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ200 + [CONTRACT_HASH] ... +ꜩ200 + +New contract [CONTRACT_HASH] originated. +Contract memorized as originate_contract.tz. + +./tezos-client --mode mockup --wait none transfer 1 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --arg Unit +Node is bootstrapped. +Estimated gas: 3524.252 units (will add 100 for safety) +Estimated storage: 295 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000614 + Expected counter: 1 + Gas limit: 3625 + Storage limit: 315 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000614 + payload fees(the block proposer) ....... +ꜩ0.000614 + Transaction: + Amount: ꜩ1 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: Unit + Storage size: 93 bytes + Consumed gas: 2121.040 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + Internal operations: + Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1 + Script: + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 38 bytes + Paid storage size diff: 38 bytes + Consumed gas: 1404.067 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0095 + storage fees ........................... +ꜩ0.0095 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + +New contract [CONTRACT_HASH] originated. diff --git a/tezt/tests/expected/create_contract.ml/Kathmandu- Create contract.out b/tezt/tests/expected/create_contract.ml/Kathmandu- Create contract.out new file mode 100644 index 000000000000..eb545fa10d92 --- /dev/null +++ b/tezt/tests/expected/create_contract.ml/Kathmandu- Create contract.out @@ -0,0 +1,109 @@ + +./tezos-client --mode mockup --wait none originate contract originate_contract.tz transferring 200 from bootstrap1 running file:./tezt/tests/contracts/proto_alpha/originate_contract.tz --init Unit --burn-cap 1 +Node is bootstrapped. +Estimated gas: 1425.182 units (will add 100 for safety) +Estimated storage: 350 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000476 + Expected counter: 1 + Gas limit: 1526 + Storage limit: 370 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000476 + payload fees(the block proposer) ....... +ꜩ0.000476 + Origination: + From: [PUBLIC_KEY_HASH] + Credit: ꜩ200 + Script: + { parameter unit ; + storage unit ; + code { DROP ; + UNIT ; + AMOUNT ; + NONE key_hash ; + CREATE_CONTRACT + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } ; + DIP { DROP ; PUSH unit Unit ; NIL operation } ; + CONS ; + PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 93 bytes + Paid storage size diff: 93 bytes + Consumed gas: 1425.182 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.02325 + storage fees ........................... +ꜩ0.02325 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [PUBLIC_KEY_HASH] ... -ꜩ200 + [CONTRACT_HASH] ... +ꜩ200 + +New contract [CONTRACT_HASH] originated. +Contract memorized as originate_contract.tz. + +./tezos-client --mode mockup --wait none transfer 1 from bootstrap2 to '[CONTRACT_HASH]' --burn-cap 2 --arg Unit +Node is bootstrapped. +Estimated gas: 3523.902 units (will add 100 for safety) +Estimated storage: 295 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +and/or an external block explorer to make sure that it has been included. +This sequence of operations was run: + Manager signed operations: + From: [PUBLIC_KEY_HASH] + Fee to the baker: ꜩ0.000614 + Expected counter: 1 + Gas limit: 3624 + Storage limit: 315 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000614 + payload fees(the block proposer) ....... +ꜩ0.000614 + Transaction: + Amount: ꜩ1 + From: [PUBLIC_KEY_HASH] + To: [CONTRACT_HASH] + This transaction was successfully applied + Updated storage: Unit + Storage size: 93 bytes + Consumed gas: 2120.480 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + Internal operations: + Internal Origination: + From: [CONTRACT_HASH] + Credit: ꜩ1 + Script: + { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } + Initial storage: Unit + No delegate for this contract + This origination was successfully applied + Originated contracts: + [CONTRACT_HASH] + Storage size: 38 bytes + Paid storage size diff: 38 bytes + Consumed gas: 1404.067 + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.0095 + storage fees ........................... +ꜩ0.0095 + [PUBLIC_KEY_HASH] ... -ꜩ0.06425 + storage fees ........................... +ꜩ0.06425 + [CONTRACT_HASH] ... -ꜩ1 + [CONTRACT_HASH] ... +ꜩ1 + +New contract [CONTRACT_HASH] originated. diff --git a/tezt/tests/main.ml b/tezt/tests/main.ml index 1ff949c2ca80..6b5131d670f9 100644 --- a/tezt/tests/main.ml +++ b/tezt/tests/main.ml @@ -97,6 +97,7 @@ let register_protocol_agnostic_tests () = Client_commands.register ~protocols ; Client_run_view.register ~protocols ; Contract_hash_fun.register ~protocols ; + Create_contract.register ~protocols ; Dal.register ~protocols:[Alpha] ; Deposits_limit.register ~protocols ; Double_bake.register ~protocols:[Alpha] ; -- GitLab From 823c2e41e09808441b2ffce32721a2756c997b67 Mon Sep 17 00:00:00 2001 From: lin Date: Thu, 22 Sep 2022 13:16:53 +0900 Subject: [PATCH 2/2] Test/Pytest: Remove pytest for create contract --- ...ate_contract_from_contract_origination.out | 56 ------------------- ...ginate_contract_from_contract_transfer.out | 51 ----------------- tests_python/tests_013/test_contract.py | 26 --------- ...ate_contract_from_contract_origination.out | 56 ------------------- ...ginate_contract_from_contract_transfer.out | 51 ----------------- tests_python/tests_014/test_contract.py | 26 --------- tests_python/tests_alpha/test_contract.py | 26 --------- 7 files changed, 292 deletions(-) delete mode 100644 tests_python/tests_013/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_origination.out delete mode 100644 tests_python/tests_013/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out delete mode 100644 tests_python/tests_014/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_origination.out delete mode 100644 tests_python/tests_014/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out diff --git a/tests_python/tests_013/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_origination.out b/tests_python/tests_013/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_origination.out deleted file mode 100644 index e29d974eb23d..000000000000 --- a/tests_python/tests_013/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_origination.out +++ /dev/null @@ -1,56 +0,0 @@ -tests_013/test_contract.py::TestOriginateContractFromContract::test_originate_contract_from_contract_origination - -Node is bootstrapped. -Estimated gas: 1425.542 units (will add 100 for safety) -Estimated storage: 350 bytes added (will add 20 for safety) -Operation successfully injected in the node. -Operation hash is '[BLOCK_HASH]' -NOT waiting for the operation to be included. -Use command - tezos-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000476 - Expected counter: [EXPECTED_COUNTER] - Gas limit: 1526 - Storage limit: 370 bytes - Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000476 - payload fees(the block proposer) ....... +ꜩ0.000476 - Origination: - From: [CONTRACT_HASH] - Credit: ꜩ200 - Script: - { parameter unit ; - storage unit ; - code { DROP ; - UNIT ; - AMOUNT ; - NONE key_hash ; - CREATE_CONTRACT - { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } ; - DIP { DROP ; PUSH unit Unit ; NIL operation } ; - CONS ; - PAIR } } - Initial storage: Unit - No delegate for this contract - This origination was successfully applied - Originated contracts: - [CONTRACT_HASH] - Storage size: 93 bytes - Paid storage size diff: 93 bytes - Consumed gas: 1425.542 - Balance updates: - [CONTRACT_HASH] ... -ꜩ0.02325 - storage fees ........................... +ꜩ0.02325 - [CONTRACT_HASH] ... -ꜩ0.06425 - storage fees ........................... +ꜩ0.06425 - [CONTRACT_HASH] ... -ꜩ200 - [CONTRACT_HASH] ... +ꜩ200 - -New contract [CONTRACT_HASH] originated. -Contract memorized as originate_contract. -Injected block at minimal timestamp -[ [], [], [], [ "[BLOCK_HASH]" ] ] diff --git a/tests_python/tests_013/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out b/tests_python/tests_013/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out deleted file mode 100644 index e4392b2a9bf7..000000000000 --- a/tests_python/tests_013/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out +++ /dev/null @@ -1,51 +0,0 @@ -tests_013/test_contract.py::TestOriginateContractFromContract::test_originate_contract_from_contract_transfer - -Node is bootstrapped. -Estimated gas: 3525.107 units (will add 100 for safety) -Estimated storage: 295 bytes added (will add 20 for safety) -Operation successfully injected in the node. -Operation hash is '[BLOCK_HASH]' -NOT waiting for the operation to be included. -Use command - tezos-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000612 - Expected counter: [EXPECTED_COUNTER] - Gas limit: 3626 - Storage limit: 315 bytes - Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000612 - payload fees(the block proposer) ....... +ꜩ0.000612 - Transaction: - Amount: ꜩ0 - From: [CONTRACT_HASH] - To: [CONTRACT_HASH] - This transaction was successfully applied - Updated storage: Unit - Storage size: 93 bytes - Consumed gas: 2121.040 - Internal operations: - Origination: - From: [CONTRACT_HASH] - Credit: ꜩ0 - Script: - { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } - Initial storage: Unit - No delegate for this contract - This origination was successfully applied - Originated contracts: - [CONTRACT_HASH] - Storage size: 38 bytes - Paid storage size diff: 38 bytes - Consumed gas: 1404.067 - Balance updates: - [CONTRACT_HASH] ... -ꜩ0.0095 - storage fees ........................... +ꜩ0.0095 - [CONTRACT_HASH] ... -ꜩ0.06425 - storage fees ........................... +ꜩ0.06425 - -New contract [CONTRACT_HASH] originated. -Injected block at minimal timestamp diff --git a/tests_python/tests_013/test_contract.py b/tests_python/tests_013/test_contract.py index 7de19a515709..e7f0d999cbf0 100644 --- a/tests_python/tests_013/test_contract.py +++ b/tests_python/tests_013/test_contract.py @@ -2288,29 +2288,3 @@ code {{ self.check_contract_ko( client, kt1, None, root_type, type_mismatch_error ) - - -@pytest.mark.incremental -@pytest.mark.contract -@pytest.mark.regression -class TestOriginateContractFromContract: - def test_originate_contract_from_contract_origination( - self, client_regtest_scrubbed, session - ): - client = client_regtest_scrubbed - path = os.path.join( - CONTRACT_PATH, 'mini_scenarios', 'originate_contract.tz' - ) - originate(client, session, path, 'Unit', 200) - - def test_originate_contract_from_contract_transfer( - self, client_regtest_scrubbed - ): - client = client_regtest_scrubbed - client.transfer( - 0, - 'bootstrap2', - 'originate_contract', - ['--arg', 'Unit', '--burn-cap', '2'], - ) - utils.bake(client, 'bootstrap5') diff --git a/tests_python/tests_014/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_origination.out b/tests_python/tests_014/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_origination.out deleted file mode 100644 index 8fd26472351a..000000000000 --- a/tests_python/tests_014/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_origination.out +++ /dev/null @@ -1,56 +0,0 @@ -tests_014/test_contract.py::TestOriginateContractFromContract::test_originate_contract_from_contract_origination - -Node is bootstrapped. -Estimated gas: 1425.182 units (will add 100 for safety) -Estimated storage: 350 bytes added (will add 20 for safety) -Operation successfully injected in the node. -Operation hash is '[BLOCK_HASH]' -NOT waiting for the operation to be included. -Use command - tezos-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000476 - Expected counter: [EXPECTED_COUNTER] - Gas limit: 1526 - Storage limit: 370 bytes - Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000476 - payload fees(the block proposer) ....... +ꜩ0.000476 - Origination: - From: [CONTRACT_HASH] - Credit: ꜩ200 - Script: - { parameter unit ; - storage unit ; - code { DROP ; - UNIT ; - AMOUNT ; - NONE key_hash ; - CREATE_CONTRACT - { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } ; - DIP { DROP ; PUSH unit Unit ; NIL operation } ; - CONS ; - PAIR } } - Initial storage: Unit - No delegate for this contract - This origination was successfully applied - Originated contracts: - [CONTRACT_HASH] - Storage size: 93 bytes - Paid storage size diff: 93 bytes - Consumed gas: 1425.182 - Balance updates: - [CONTRACT_HASH] ... -ꜩ0.02325 - storage fees ........................... +ꜩ0.02325 - [CONTRACT_HASH] ... -ꜩ0.06425 - storage fees ........................... +ꜩ0.06425 - [CONTRACT_HASH] ... -ꜩ200 - [CONTRACT_HASH] ... +ꜩ200 - -New contract [CONTRACT_HASH] originated. -Contract memorized as originate_contract. -Injected block at minimal timestamp -[ [], [], [], [ "[BLOCK_HASH]" ] ] diff --git a/tests_python/tests_014/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out b/tests_python/tests_014/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out deleted file mode 100644 index 68d24c32e248..000000000000 --- a/tests_python/tests_014/_regtest_outputs/test_contract.TestOriginateContractFromContract::test_originate_contract_from_contract_transfer.out +++ /dev/null @@ -1,51 +0,0 @@ -tests_014/test_contract.py::TestOriginateContractFromContract::test_originate_contract_from_contract_transfer - -Node is bootstrapped. -Estimated gas: 3524.547 units (will add 100 for safety) -Estimated storage: 295 bytes added (will add 20 for safety) -Operation successfully injected in the node. -Operation hash is '[BLOCK_HASH]' -NOT waiting for the operation to be included. -Use command - tezos-client wait for [BLOCK_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] -and/or an external block explorer to make sure that it has been included. -This sequence of operations was run: - Manager signed operations: - From: [CONTRACT_HASH] - Fee to the baker: ꜩ0.000612 - Expected counter: [EXPECTED_COUNTER] - Gas limit: 3625 - Storage limit: 315 bytes - Balance updates: - [CONTRACT_HASH] ... -ꜩ0.000612 - payload fees(the block proposer) ....... +ꜩ0.000612 - Transaction: - Amount: ꜩ0 - From: [CONTRACT_HASH] - To: [CONTRACT_HASH] - This transaction was successfully applied - Updated storage: Unit - Storage size: 93 bytes - Consumed gas: 2120.480 - Internal operations: - Internal Origination: - From: [CONTRACT_HASH] - Credit: ꜩ0 - Script: - { parameter unit ; storage unit ; code { CDR ; NIL operation ; PAIR } } - Initial storage: Unit - No delegate for this contract - This origination was successfully applied - Originated contracts: - [CONTRACT_HASH] - Storage size: 38 bytes - Paid storage size diff: 38 bytes - Consumed gas: 1404.067 - Balance updates: - [CONTRACT_HASH] ... -ꜩ0.0095 - storage fees ........................... +ꜩ0.0095 - [CONTRACT_HASH] ... -ꜩ0.06425 - storage fees ........................... +ꜩ0.06425 - -New contract [CONTRACT_HASH] originated. -Injected block at minimal timestamp diff --git a/tests_python/tests_014/test_contract.py b/tests_python/tests_014/test_contract.py index 973491eb63f0..b13254560aca 100644 --- a/tests_python/tests_014/test_contract.py +++ b/tests_python/tests_014/test_contract.py @@ -2285,32 +2285,6 @@ code {{ ) -@pytest.mark.incremental -@pytest.mark.contract -@pytest.mark.regression -class TestOriginateContractFromContract: - def test_originate_contract_from_contract_origination( - self, client_regtest_scrubbed, session - ): - client = client_regtest_scrubbed - path = os.path.join( - CONTRACT_PATH, 'mini_scenarios', 'originate_contract.tz' - ) - originate(client, session, path, 'Unit', 200) - - def test_originate_contract_from_contract_transfer( - self, client_regtest_scrubbed - ): - client = client_regtest_scrubbed - client.transfer( - 0, - 'bootstrap2', - 'originate_contract', - ['--arg', 'Unit', '--burn-cap', '2'], - ) - utils.bake(client, 'bootstrap5') - - @pytest.mark.incremental @pytest.mark.contract @pytest.mark.regression diff --git a/tests_python/tests_alpha/test_contract.py b/tests_python/tests_alpha/test_contract.py index 99f39557a1a4..f2addcdb1c91 100644 --- a/tests_python/tests_alpha/test_contract.py +++ b/tests_python/tests_alpha/test_contract.py @@ -2285,32 +2285,6 @@ code {{ ) -@pytest.mark.incremental -@pytest.mark.contract -@pytest.mark.regression -class TestOriginateContractFromContract: - def test_originate_contract_from_contract_origination( - self, client_regtest_scrubbed, session - ): - client = client_regtest_scrubbed - path = os.path.join( - CONTRACT_PATH, 'mini_scenarios', 'originate_contract.tz' - ) - originate(client, session, path, 'Unit', 200) - - def test_originate_contract_from_contract_transfer( - self, client_regtest_scrubbed - ): - client = client_regtest_scrubbed - client.transfer( - 0, - 'bootstrap2', - 'originate_contract', - ['--arg', 'Unit', '--burn-cap', '2'], - ) - utils.bake(client, 'bootstrap5') - - @pytest.mark.incremental @pytest.mark.contract @pytest.mark.regression -- GitLab