-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
Debugger support for State and State[] is currently incomplete in two ways.
- Argument parsing is missing
debugger/session/src/args.rscannot parse struct-shaped call arguments, so the debugger cannot run entrypoints that takeStateorState[].
Current behavior:
Stateis rejected as an unsupported typeState[]rejects JSON object elements with:unsupported array element (expected number/bool/string)
- The debugger does not apply the compiler’s lowering model
A source-level argument like:
State[] new_statesdoes not remain a single runtime argument. The compiler lowers struct arrays into one runtime array per field before building the sigscript.
For example, if State has:
int amount;
byte[32] owner;then State[] new_states is lowered into runtime data equivalent to:
int[] new_amount
byte[32][] new_ownerSo fixing parsing alone is not enough. The debugger also needs to lower structured arguments the same way as the compiler, or it will still build the wrong call representation.
The compiler/runtime path already handles this through:
CompiledContract::build_sig_scriptpush_typed_sigscript_arg
Requested behavior:
- support
State/ struct object arguments in debugger CLI/session - support
State[]/ struct-array arguments in debugger CLI/session - ensure debugger call construction uses the compiler’s lowering rules, while debugger-visible arguments and values remain understandable in source-level
State/State[]terms
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels