Skip to content

Commit

Permalink
fix: fix incorrectly mapped transaction arguments global_num_uint a…
Browse files Browse the repository at this point in the history
…nd `local_num_uint` in `algopy.arc4.abi_call` #232
  • Loading branch information
daniel-makerx authored May 21, 2024
1 parent 3841ec4 commit 0c35caa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/puya/awst/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ class TxnFields:
TxnFields.approval_program_pages,
TxnFields.clear_state_program_pages,
]
TXN_FIELDS_BY_IMMEDIATE = {f.immediate: f for f in TXN_FIELDS}
INNER_PARAM_TXN_FIELDS = [f for f in TXN_FIELDS if f.is_inner_param]


Expand Down
37 changes: 19 additions & 18 deletions src/puya/awst_build/eb/arc4/abi_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from puya import log
from puya.awst import wtypes
from puya.awst.nodes import (
TXN_FIELDS,
TXN_FIELDS_BY_IMMEDIATE,
ARC4Decode,
BytesConstant,
BytesEncoding,
Expand Down Expand Up @@ -58,23 +58,24 @@

logger = log.get_logger(__name__)
_APP_TRANSACTION_FIELDS = {
get_field_python_name(f): f
for f in TXN_FIELDS
if f.immediate
in (
"ApplicationID",
"OnCompletion",
"ApprovalProgram",
"ClearStateProgram",
"GlobalNumUInt",
"GlobalNumByteSlice",
"LocalNumUInt",
"LocalNumByteSlice",
"ExtraProgramPages",
"Fee",
"Sender",
"Note",
"RekeyTo",
get_field_python_name(field): field
for field in (
TXN_FIELDS_BY_IMMEDIATE[immediate]
for immediate in (
"ApplicationID",
"OnCompletion",
"ApprovalProgram",
"ClearStateProgram",
"GlobalNumUint",
"GlobalNumByteSlice",
"LocalNumUint",
"LocalNumByteSlice",
"ExtraProgramPages",
"Fee",
"Sender",
"Note",
"RekeyTo",
)
)
}

Expand Down

0 comments on commit 0c35caa

Please sign in to comment.