algokit-utils 3.0.0b9__py3-none-any.whl → 3.0.0b10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of algokit-utils might be problematic. Click here for more details.
- algokit_utils/applications/app_spec/arc56.py +40 -15
- {algokit_utils-3.0.0b9.dist-info → algokit_utils-3.0.0b10.dist-info}/METADATA +1 -1
- {algokit_utils-3.0.0b9.dist-info → algokit_utils-3.0.0b10.dist-info}/RECORD +5 -5
- {algokit_utils-3.0.0b9.dist-info → algokit_utils-3.0.0b10.dist-info}/LICENSE +0 -0
- {algokit_utils-3.0.0b9.dist-info → algokit_utils-3.0.0b10.dist-info}/WHEEL +0 -0
|
@@ -672,22 +672,47 @@ class SourceInfoModel:
|
|
|
672
672
|
return SourceInfoModel(**data)
|
|
673
673
|
|
|
674
674
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
675
|
+
# constants that define which parent keys mark a region whose inner keys should remain unchanged.
|
|
676
|
+
PROTECTED_TOP_DICTS = {"networks", "scratch_variables", "template_variables", "structs"}
|
|
677
|
+
STATE_PROTECTED_PARENTS = {"keys", "maps"}
|
|
678
|
+
STATE_PROTECTED_CHILDREN = {"global", "local", "box"}
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
def _is_protected_path(path: tuple[str, ...]) -> bool:
|
|
682
|
+
"""
|
|
683
|
+
Return True if the current recursion path indicates that we are inside a protected dictionary,
|
|
684
|
+
meaning that the keys should be left unchanged.
|
|
685
|
+
"""
|
|
686
|
+
return (len(path) >= 2 and path[-2] in STATE_PROTECTED_PARENTS and path[-1] in STATE_PROTECTED_CHILDREN) or ( # noqa: PLR2004
|
|
687
|
+
len(path) >= 1 and path[-1] in PROTECTED_TOP_DICTS
|
|
688
|
+
)
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
def _dict_keys_to_snake_case(value: Any, path: tuple[str, ...] = ()) -> Any: # noqa: ANN401
|
|
692
|
+
"""Recursively convert dictionary keys to snake_case except in protected sections.
|
|
693
|
+
|
|
694
|
+
A dictionary is not converted if it is directly under:
|
|
695
|
+
- keys/maps sections ("global", "local", "box")
|
|
696
|
+
- or one of the top-level keys ("networks", "scratchVariables", "templateVariables", "structs")
|
|
697
|
+
(Note that once converted the parent key names become snake_case.)
|
|
698
|
+
"""
|
|
699
|
+
import re
|
|
700
|
+
|
|
678
701
|
def camel_to_snake(s: str) -> str:
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
702
|
+
# Use a regular expression to insert an underscore before capital letters (except at start).
|
|
703
|
+
return re.sub(r"(?<!^)(?=[A-Z])", "_", s).lower()
|
|
704
|
+
|
|
705
|
+
if isinstance(value, dict):
|
|
706
|
+
protected = _is_protected_path(path)
|
|
707
|
+
new_dict = {}
|
|
708
|
+
for key, val in value.items():
|
|
709
|
+
new_key = key if protected else camel_to_snake(key)
|
|
710
|
+
new_dict[new_key] = _dict_keys_to_snake_case(val, (*path, new_key))
|
|
711
|
+
return new_dict
|
|
712
|
+
elif isinstance(value, list):
|
|
713
|
+
return [_dict_keys_to_snake_case(item, path) for item in value]
|
|
714
|
+
else:
|
|
715
|
+
return value
|
|
691
716
|
|
|
692
717
|
|
|
693
718
|
class _Arc32ToArc56Converter:
|
|
@@ -27,7 +27,7 @@ algokit_utils/applications/app_factory.py,sha256=wljyXuXWaMc3KJkDeACJ5XVEfIsVxeS
|
|
|
27
27
|
algokit_utils/applications/app_manager.py,sha256=EA1uRtmvPVAdKi1I5HSCpHjIDgLN7eZcEPT0Cj3C7fU,17661
|
|
28
28
|
algokit_utils/applications/app_spec/__init__.py,sha256=HtjAhAqHNFml9WbRKGmhJnwyJeW8AztPRO_BriQ84vs,140
|
|
29
29
|
algokit_utils/applications/app_spec/arc32.py,sha256=8MMGUopPzkWq48rl5sYbc2Awf-RKnxSX8F0P0UibK5M,7523
|
|
30
|
-
algokit_utils/applications/app_spec/arc56.py,sha256=
|
|
30
|
+
algokit_utils/applications/app_spec/arc56.py,sha256=LS-EA4lYNe6kCR9z6lvB8tGLV-t4qLe3Rttg2Wg5z7Y,32984
|
|
31
31
|
algokit_utils/applications/enums.py,sha256=1MUBrPW9v0-OZk6jsa5rqSEEpC-z-6QAQIs9G7pLn1I,1257
|
|
32
32
|
algokit_utils/asset.py,sha256=ZnNo_MsDGPb8UTPxi7cmIZpbrT0x0xZjblHP01pDAC0,874
|
|
33
33
|
algokit_utils/assets/__init__.py,sha256=6igogt0eo0TEae6-rO9qPsmlrKkbnkq3aV8wtePX3yk,63
|
|
@@ -64,7 +64,7 @@ algokit_utils/transactions/__init__.py,sha256=7fYF3m6DyOGzbV36MT5svo0wSkj9AIz496
|
|
|
64
64
|
algokit_utils/transactions/transaction_composer.py,sha256=S9GrGDCTg0JJa4HbcTVbGAsV_qAHW2xWNiT9olo6_tk,96058
|
|
65
65
|
algokit_utils/transactions/transaction_creator.py,sha256=A1YHeGC2EkR2V0HPYJiXVOAEIrfjBW2KVyYgi3exm4E,6167
|
|
66
66
|
algokit_utils/transactions/transaction_sender.py,sha256=uQmHElJgUIxLXfdklMNoabjQQzUku8CFP82wwhfr44E,22769
|
|
67
|
-
algokit_utils-3.0.
|
|
68
|
-
algokit_utils-3.0.
|
|
69
|
-
algokit_utils-3.0.
|
|
70
|
-
algokit_utils-3.0.
|
|
67
|
+
algokit_utils-3.0.0b10.dist-info/LICENSE,sha256=J5i7U1Q9Q2c7saUzlvFRmrCCFhQyXb5Juz_LO5omNUw,1076
|
|
68
|
+
algokit_utils-3.0.0b10.dist-info/METADATA,sha256=uSusbjVEq43dNLdD_nfzk-AvBleVdY-TgCxCVOvbGC0,2421
|
|
69
|
+
algokit_utils-3.0.0b10.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
70
|
+
algokit_utils-3.0.0b10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|