From 5bf9c6411097756951b72ff1132734f540ebd37b Mon Sep 17 00:00:00 2001 From: Daniel McGregor Date: Fri, 18 Oct 2024 19:40:24 +0800 Subject: [PATCH] test: normalize ARC-56 output --- examples/amm/out/ConstantProductAMM.arc56.json | 6 +++--- examples/arc_28/out/EventEmitter.arc56.json | 6 +++--- examples/auction/out/Auction.arc56.json | 6 +++--- examples/box_storage/out/BoxContract.arc56.json | 6 +++--- .../out/HelloWorldContract.arc56.json | 6 +++--- examples/merkle/out/MerkleTree.arc56.json | 6 +++--- .../struct_in_box/out/ExampleContract.arc56.json | 6 +++--- .../tictactoe/out/TicTacToeContract.arc56.json | 6 +++--- examples/voting/out/VotingRoundApp.arc56.json | 6 +++--- scripts/compile_all_examples.py | 15 +++++++++++++++ .../abi_routing/out/CustomApproval.arc56.json | 6 +++--- test_cases/abi_routing/out/MinimumARC4.arc56.json | 6 +++--- test_cases/abi_routing/out/Reference.arc56.json | 6 +++--- .../out/DynamicArrayContract.arc56.json | 6 +++--- .../out/Arc4DynamicStringArrayContract.arc56.json | 6 +++--- test_cases/arc_56/out/Contract.arc56.json | 6 +++--- .../avm_types_in_abi/out/TestContract.arc56.json | 6 +++--- test_cases/compile/out/Hello.arc56.json | 6 +++--- test_cases/compile/out/HelloBase.arc56.json | 6 +++--- test_cases/compile/out/HelloFactory.arc56.json | 6 +++--- .../compile/out/HelloOtherConstants.arc56.json | 6 +++--- test_cases/compile/out/HelloPrfx.arc56.json | 6 +++--- test_cases/compile/out/HelloTmpl.arc56.json | 6 +++--- test_cases/compile/out/LargeProgram.arc56.json | 6 +++--- test_cases/debug/out/DebugContract.arc56.json | 6 +++--- test_cases/diamond_mro/out/Base1.arc56.json | 6 +++--- test_cases/diamond_mro/out/Base2.arc56.json | 6 +++--- test_cases/diamond_mro/out/Derived.arc56.json | 6 +++--- test_cases/diamond_mro/out/GP.arc56.json | 6 +++--- test_cases/everything/out/MyContract.arc56.json | 6 +++--- .../group_side_effects/out/AppCall.arc56.json | 6 +++--- .../out/AppExpectingEffects.arc56.json | 6 +++--- .../out/ArrayAccessContract.arc56.json | 6 +++--- .../out/CreateAndTransferContract.arc56.json | 6 +++--- .../out/FieldTupleContract.arc56.json | 6 +++--- .../inner_transactions/out/Greeter.arc56.json | 6 +++--- .../out/Contract.arc56.json | 6 +++--- .../regression_tests/out/Issue118.arc56.json | 6 +++--- .../reinterpret_cast/out/Contract.arc56.json | 6 +++--- .../state_mutations/out/Contract.arc56.json | 6 +++--- .../out/StateProxyContract.arc56.json | 6 +++--- test_cases/state_totals/out/Contract.arc56.json | 6 +++--- .../out/TemplateVariablesContract.arc56.json | 6 +++--- .../out/TransactionContract.arc56.json | 6 +++--- .../tuple_support/out/NestedTuples.arc56.json | 6 +++--- test_cases/typed_abi_call/out/Greeter.arc56.json | 6 +++--- test_cases/typed_abi_call/out/Logger.arc56.json | 6 +++--- .../typed_abi_call_txn/out/Caller.arc56.json | 6 +++--- .../typed_abi_call_txn/out/TxnContract.arc56.json | 6 +++--- .../out/Unassigned.arc56.json | 6 +++--- tests/test_compile.py | 14 ++++++++++++++ 51 files changed, 176 insertions(+), 147 deletions(-) diff --git a/examples/amm/out/ConstantProductAMM.arc56.json b/examples/amm/out/ConstantProductAMM.arc56.json index cd5f673940..ffaf94e0cd 100644 --- a/examples/amm/out/ConstantProductAMM.arc56.json +++ b/examples/amm/out/ConstantProductAMM.arc56.json @@ -498,9 +498,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/examples/arc_28/out/EventEmitter.arc56.json b/examples/arc_28/out/EventEmitter.arc56.json index c17764ebfd..8492e0dfb0 100644 --- a/examples/arc_28/out/EventEmitter.arc56.json +++ b/examples/arc_28/out/EventEmitter.arc56.json @@ -211,9 +211,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/examples/auction/out/Auction.arc56.json b/examples/auction/out/Auction.arc56.json index 00ad153d70..0c0aa83861 100644 --- a/examples/auction/out/Auction.arc56.json +++ b/examples/auction/out/Auction.arc56.json @@ -352,9 +352,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/examples/box_storage/out/BoxContract.arc56.json b/examples/box_storage/out/BoxContract.arc56.json index dbeaa226a2..7c06cfe4dc 100644 --- a/examples/box_storage/out/BoxContract.arc56.json +++ b/examples/box_storage/out/BoxContract.arc56.json @@ -467,9 +467,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/examples/hello_world_arc4/out/HelloWorldContract.arc56.json b/examples/hello_world_arc4/out/HelloWorldContract.arc56.json index ed6418367a..76f0f02f56 100644 --- a/examples/hello_world_arc4/out/HelloWorldContract.arc56.json +++ b/examples/hello_world_arc4/out/HelloWorldContract.arc56.json @@ -99,9 +99,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/examples/merkle/out/MerkleTree.arc56.json b/examples/merkle/out/MerkleTree.arc56.json index 361b500872..34ab180aed 100644 --- a/examples/merkle/out/MerkleTree.arc56.json +++ b/examples/merkle/out/MerkleTree.arc56.json @@ -135,9 +135,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/examples/struct_in_box/out/ExampleContract.arc56.json b/examples/struct_in_box/out/ExampleContract.arc56.json index d3b122752b..98008dc2d5 100644 --- a/examples/struct_in_box/out/ExampleContract.arc56.json +++ b/examples/struct_in_box/out/ExampleContract.arc56.json @@ -178,9 +178,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/examples/tictactoe/out/TicTacToeContract.arc56.json b/examples/tictactoe/out/TicTacToeContract.arc56.json index d2a3ad7b94..627b4902ef 100644 --- a/examples/tictactoe/out/TicTacToeContract.arc56.json +++ b/examples/tictactoe/out/TicTacToeContract.arc56.json @@ -260,9 +260,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/examples/voting/out/VotingRoundApp.arc56.json b/examples/voting/out/VotingRoundApp.arc56.json index 3e6062a3fb..8aae485e0d 100644 --- a/examples/voting/out/VotingRoundApp.arc56.json +++ b/examples/voting/out/VotingRoundApp.arc56.json @@ -487,9 +487,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/scripts/compile_all_examples.py b/scripts/compile_all_examples.py index d52525c3ef..1bd0f87ed0 100755 --- a/scripts/compile_all_examples.py +++ b/scripts/compile_all_examples.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import argparse +import json import operator import os import re @@ -233,6 +234,11 @@ def checked_compile( ) bin_files_written = re.findall(r"info: Writing (.+\.bin)", result.stdout) + # normalize ARC-56 output + arc56_files_written = re.findall(r"info: Writing (.+\.arc56\.json)", result.stdout) + for arc56_file in arc56_files_written: + _normalize_arc56(root / arc56_file) + if write_logs: if p.is_dir(): log_path = p / "puya.log" @@ -250,6 +256,15 @@ def checked_compile( ) +def _normalize_arc56(path: Path) -> None: + arc56 = json.loads(path.read_text()) + compiler_version = arc56.get("compilerInfo", {}).get("compilerVersion", {}) + compiler_version["major"] = 99 + compiler_version["minor"] = 99 + compiler_version["patch"] = 99 + path.write_text(json.dumps(arc56, indent=4), encoding="utf8") + + def _load_template_vars(path: Path) -> Iterable[str]: if path.exists(): for line in path.read_text("utf8").splitlines(): diff --git a/test_cases/abi_routing/out/CustomApproval.arc56.json b/test_cases/abi_routing/out/CustomApproval.arc56.json index d988c89b28..7f1f1cc2f6 100644 --- a/test_cases/abi_routing/out/CustomApproval.arc56.json +++ b/test_cases/abi_routing/out/CustomApproval.arc56.json @@ -105,9 +105,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/abi_routing/out/MinimumARC4.arc56.json b/test_cases/abi_routing/out/MinimumARC4.arc56.json index 5d874f0471..93a9cbb0e2 100644 --- a/test_cases/abi_routing/out/MinimumARC4.arc56.json +++ b/test_cases/abi_routing/out/MinimumARC4.arc56.json @@ -71,9 +71,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/abi_routing/out/Reference.arc56.json b/test_cases/abi_routing/out/Reference.arc56.json index 2e9d89be00..5b71997bbe 100644 --- a/test_cases/abi_routing/out/Reference.arc56.json +++ b/test_cases/abi_routing/out/Reference.arc56.json @@ -790,9 +790,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/arc4_dynamic_arrays/out/DynamicArrayContract.arc56.json b/test_cases/arc4_dynamic_arrays/out/DynamicArrayContract.arc56.json index 67b42fac52..1aeef2382b 100644 --- a/test_cases/arc4_dynamic_arrays/out/DynamicArrayContract.arc56.json +++ b/test_cases/arc4_dynamic_arrays/out/DynamicArrayContract.arc56.json @@ -202,9 +202,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicStringArrayContract.arc56.json b/test_cases/arc4_types/out/Arc4DynamicStringArrayContract.arc56.json index 9a5170a712..9e06f605f5 100644 --- a/test_cases/arc4_types/out/Arc4DynamicStringArrayContract.arc56.json +++ b/test_cases/arc4_types/out/Arc4DynamicStringArrayContract.arc56.json @@ -112,9 +112,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/arc_56/out/Contract.arc56.json b/test_cases/arc_56/out/Contract.arc56.json index fec334a26a..402a505a6b 100644 --- a/test_cases/arc_56/out/Contract.arc56.json +++ b/test_cases/arc_56/out/Contract.arc56.json @@ -487,9 +487,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/avm_types_in_abi/out/TestContract.arc56.json b/test_cases/avm_types_in_abi/out/TestContract.arc56.json index a7df0b736f..0da45c2ee6 100644 --- a/test_cases/avm_types_in_abi/out/TestContract.arc56.json +++ b/test_cases/avm_types_in_abi/out/TestContract.arc56.json @@ -145,9 +145,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/compile/out/Hello.arc56.json b/test_cases/compile/out/Hello.arc56.json index 5b41e29e55..5d38b0687a 100644 --- a/test_cases/compile/out/Hello.arc56.json +++ b/test_cases/compile/out/Hello.arc56.json @@ -157,9 +157,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/compile/out/HelloBase.arc56.json b/test_cases/compile/out/HelloBase.arc56.json index 2a07b116b9..d717836194 100644 --- a/test_cases/compile/out/HelloBase.arc56.json +++ b/test_cases/compile/out/HelloBase.arc56.json @@ -137,9 +137,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/compile/out/HelloFactory.arc56.json b/test_cases/compile/out/HelloFactory.arc56.json index f9dd434125..2df6230874 100644 --- a/test_cases/compile/out/HelloFactory.arc56.json +++ b/test_cases/compile/out/HelloFactory.arc56.json @@ -309,9 +309,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/compile/out/HelloOtherConstants.arc56.json b/test_cases/compile/out/HelloOtherConstants.arc56.json index 79a8b500b8..91780311f8 100644 --- a/test_cases/compile/out/HelloOtherConstants.arc56.json +++ b/test_cases/compile/out/HelloOtherConstants.arc56.json @@ -200,9 +200,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/compile/out/HelloPrfx.arc56.json b/test_cases/compile/out/HelloPrfx.arc56.json index cae8478c5f..ca5e32a1a0 100644 --- a/test_cases/compile/out/HelloPrfx.arc56.json +++ b/test_cases/compile/out/HelloPrfx.arc56.json @@ -157,9 +157,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/compile/out/HelloTmpl.arc56.json b/test_cases/compile/out/HelloTmpl.arc56.json index cc1525bc93..1a36e3df45 100644 --- a/test_cases/compile/out/HelloTmpl.arc56.json +++ b/test_cases/compile/out/HelloTmpl.arc56.json @@ -157,9 +157,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/compile/out/LargeProgram.arc56.json b/test_cases/compile/out/LargeProgram.arc56.json index e1e9a32a0b..2465f8a82e 100644 --- a/test_cases/compile/out/LargeProgram.arc56.json +++ b/test_cases/compile/out/LargeProgram.arc56.json @@ -117,9 +117,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/debug/out/DebugContract.arc56.json b/test_cases/debug/out/DebugContract.arc56.json index 376ae26e73..ab54d3a2b2 100644 --- a/test_cases/debug/out/DebugContract.arc56.json +++ b/test_cases/debug/out/DebugContract.arc56.json @@ -112,9 +112,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/diamond_mro/out/Base1.arc56.json b/test_cases/diamond_mro/out/Base1.arc56.json index 0ec552fc53..19e4a807d6 100644 --- a/test_cases/diamond_mro/out/Base1.arc56.json +++ b/test_cases/diamond_mro/out/Base1.arc56.json @@ -109,9 +109,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/diamond_mro/out/Base2.arc56.json b/test_cases/diamond_mro/out/Base2.arc56.json index aa335c026c..076deb3996 100644 --- a/test_cases/diamond_mro/out/Base2.arc56.json +++ b/test_cases/diamond_mro/out/Base2.arc56.json @@ -109,9 +109,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/diamond_mro/out/Derived.arc56.json b/test_cases/diamond_mro/out/Derived.arc56.json index 3e1ff20747..a57139ffb9 100644 --- a/test_cases/diamond_mro/out/Derived.arc56.json +++ b/test_cases/diamond_mro/out/Derived.arc56.json @@ -109,9 +109,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/diamond_mro/out/GP.arc56.json b/test_cases/diamond_mro/out/GP.arc56.json index 37c2aee8da..f46f8adb13 100644 --- a/test_cases/diamond_mro/out/GP.arc56.json +++ b/test_cases/diamond_mro/out/GP.arc56.json @@ -109,9 +109,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/everything/out/MyContract.arc56.json b/test_cases/everything/out/MyContract.arc56.json index c68cf49094..3bd1bb81b1 100644 --- a/test_cases/everything/out/MyContract.arc56.json +++ b/test_cases/everything/out/MyContract.arc56.json @@ -225,9 +225,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/group_side_effects/out/AppCall.arc56.json b/test_cases/group_side_effects/out/AppCall.arc56.json index cc3be88cde..10c437a73d 100644 --- a/test_cases/group_side_effects/out/AppCall.arc56.json +++ b/test_cases/group_side_effects/out/AppCall.arc56.json @@ -94,9 +94,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/group_side_effects/out/AppExpectingEffects.arc56.json b/test_cases/group_side_effects/out/AppExpectingEffects.arc56.json index cb39843569..b25dbfde3b 100644 --- a/test_cases/group_side_effects/out/AppExpectingEffects.arc56.json +++ b/test_cases/group_side_effects/out/AppExpectingEffects.arc56.json @@ -181,9 +181,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/inner_transactions/out/ArrayAccessContract.arc56.json b/test_cases/inner_transactions/out/ArrayAccessContract.arc56.json index cf261cd3a9..0c6d0034c3 100644 --- a/test_cases/inner_transactions/out/ArrayAccessContract.arc56.json +++ b/test_cases/inner_transactions/out/ArrayAccessContract.arc56.json @@ -119,9 +119,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/inner_transactions/out/CreateAndTransferContract.arc56.json b/test_cases/inner_transactions/out/CreateAndTransferContract.arc56.json index 75894b5707..769f63f5c5 100644 --- a/test_cases/inner_transactions/out/CreateAndTransferContract.arc56.json +++ b/test_cases/inner_transactions/out/CreateAndTransferContract.arc56.json @@ -100,9 +100,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/inner_transactions/out/FieldTupleContract.arc56.json b/test_cases/inner_transactions/out/FieldTupleContract.arc56.json index 4022c69f89..dcea2e0518 100644 --- a/test_cases/inner_transactions/out/FieldTupleContract.arc56.json +++ b/test_cases/inner_transactions/out/FieldTupleContract.arc56.json @@ -112,9 +112,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/inner_transactions/out/Greeter.arc56.json b/test_cases/inner_transactions/out/Greeter.arc56.json index ad02bc208a..19b108c927 100644 --- a/test_cases/inner_transactions/out/Greeter.arc56.json +++ b/test_cases/inner_transactions/out/Greeter.arc56.json @@ -143,9 +143,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/inner_transactions_assignment/out/Contract.arc56.json b/test_cases/inner_transactions_assignment/out/Contract.arc56.json index a8407483c2..999aadfce3 100644 --- a/test_cases/inner_transactions_assignment/out/Contract.arc56.json +++ b/test_cases/inner_transactions_assignment/out/Contract.arc56.json @@ -112,9 +112,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/regression_tests/out/Issue118.arc56.json b/test_cases/regression_tests/out/Issue118.arc56.json index fa0ae0e6ed..dd3535f7e4 100644 --- a/test_cases/regression_tests/out/Issue118.arc56.json +++ b/test_cases/regression_tests/out/Issue118.arc56.json @@ -99,9 +99,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/reinterpret_cast/out/Contract.arc56.json b/test_cases/reinterpret_cast/out/Contract.arc56.json index aaa9f26dbd..1a53e8d26e 100644 --- a/test_cases/reinterpret_cast/out/Contract.arc56.json +++ b/test_cases/reinterpret_cast/out/Contract.arc56.json @@ -112,9 +112,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/state_mutations/out/Contract.arc56.json b/test_cases/state_mutations/out/Contract.arc56.json index 6957da3b15..86c44594a1 100644 --- a/test_cases/state_mutations/out/Contract.arc56.json +++ b/test_cases/state_mutations/out/Contract.arc56.json @@ -211,9 +211,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/state_proxies/out/StateProxyContract.arc56.json b/test_cases/state_proxies/out/StateProxyContract.arc56.json index 5d62db24cc..f8eb4fdf59 100644 --- a/test_cases/state_proxies/out/StateProxyContract.arc56.json +++ b/test_cases/state_proxies/out/StateProxyContract.arc56.json @@ -112,9 +112,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/state_totals/out/Contract.arc56.json b/test_cases/state_totals/out/Contract.arc56.json index 9ed7befa91..cc55387b27 100644 --- a/test_cases/state_totals/out/Contract.arc56.json +++ b/test_cases/state_totals/out/Contract.arc56.json @@ -77,9 +77,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/template_variables/out/TemplateVariablesContract.arc56.json b/test_cases/template_variables/out/TemplateVariablesContract.arc56.json index 0060b631ce..47162456a9 100644 --- a/test_cases/template_variables/out/TemplateVariablesContract.arc56.json +++ b/test_cases/template_variables/out/TemplateVariablesContract.arc56.json @@ -140,9 +140,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/transaction/out/TransactionContract.arc56.json b/test_cases/transaction/out/TransactionContract.arc56.json index 61ead66035..a8e5ab00a4 100644 --- a/test_cases/transaction/out/TransactionContract.arc56.json +++ b/test_cases/transaction/out/TransactionContract.arc56.json @@ -739,9 +739,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/tuple_support/out/NestedTuples.arc56.json b/test_cases/tuple_support/out/NestedTuples.arc56.json index 159a3c2607..beb758fa8b 100644 --- a/test_cases/tuple_support/out/NestedTuples.arc56.json +++ b/test_cases/tuple_support/out/NestedTuples.arc56.json @@ -130,9 +130,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.arc56.json b/test_cases/typed_abi_call/out/Greeter.arc56.json index 2f3014deb1..071b59041a 100644 --- a/test_cases/typed_abi_call/out/Greeter.arc56.json +++ b/test_cases/typed_abi_call/out/Greeter.arc56.json @@ -501,9 +501,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Logger.arc56.json b/test_cases/typed_abi_call/out/Logger.arc56.json index fdb4edbf4a..759748711d 100644 --- a/test_cases/typed_abi_call/out/Logger.arc56.json +++ b/test_cases/typed_abi_call/out/Logger.arc56.json @@ -570,9 +570,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/typed_abi_call_txn/out/Caller.arc56.json b/test_cases/typed_abi_call_txn/out/Caller.arc56.json index 9acba50b51..8861a1f854 100644 --- a/test_cases/typed_abi_call_txn/out/Caller.arc56.json +++ b/test_cases/typed_abi_call_txn/out/Caller.arc56.json @@ -188,9 +188,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/typed_abi_call_txn/out/TxnContract.arc56.json b/test_cases/typed_abi_call_txn/out/TxnContract.arc56.json index 35e6bbf602..40304137ca 100644 --- a/test_cases/typed_abi_call_txn/out/TxnContract.arc56.json +++ b/test_cases/typed_abi_call_txn/out/TxnContract.arc56.json @@ -206,9 +206,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/test_cases/unassigned_expression/out/Unassigned.arc56.json b/test_cases/unassigned_expression/out/Unassigned.arc56.json index c557c85203..89680e2ba2 100644 --- a/test_cases/unassigned_expression/out/Unassigned.arc56.json +++ b/test_cases/unassigned_expression/out/Unassigned.arc56.json @@ -130,9 +130,9 @@ "compilerInfo": { "compiler": "puya", "compilerVersion": { - "major": 3, - "minor": 2, - "patch": 2 + "major": 99, + "minor": 99, + "patch": 99 } } } \ No newline at end of file diff --git a/tests/test_compile.py b/tests/test_compile.py index 43b8d531cc..12966bd6fa 100644 --- a/tests/test_compile.py +++ b/tests/test_compile.py @@ -1,3 +1,4 @@ +import json import os import shutil import subprocess @@ -82,6 +83,10 @@ def compile_test_case( encoding="utf8", ) + # normalize ARC-56 output + for arc56_file in dst_out_dir.rglob("*.arc56.json"): + _normalize_arc56(arc56_file) + def _normalize_path(path: Path | str) -> str: return str(path).replace("\\", "/") @@ -175,3 +180,12 @@ def check_for_diff(path: Path) -> str | None: ) stdout += result.stdout.decode("utf8") return stdout or None + + +def _normalize_arc56(path: Path) -> None: + arc56 = json.loads(path.read_text()) + compiler_version = arc56.get("compilerInfo", {}).get("compilerVersion", {}) + compiler_version["major"] = 99 + compiler_version["minor"] = 99 + compiler_version["patch"] = 99 + path.write_text(json.dumps(arc56, indent=4), encoding="utf8")