Skip to content

Commit c98b523

Browse files
committed
fix(zig): handle array_value in stateValueToAnf switch
StateValue gained an array_value variant for FixedArray state fields but sdk_contract.zig:stateValueToAnf wasn't updated, breaking the zig integration build with: error: switch must handle all possibilities return switch (sv) { note: unhandled enumeration value: 'array_value' FixedArray state fields are flattened into per-index scalar properties before reaching the ANF auto-state helper, so a raw array_value here has no scalar representation. Map it to .none so the computation skips the field instead of trapping the switch. Verification: - cd packages/runar-zig && zig build test -> 76/76 pass - cd integration/zig && zig build test -> exit 0, compiles clean
1 parent ba36db4 commit c98b523

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/runar-zig/src/sdk_contract.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,12 @@ fn stateValueToAnf(sv: types.StateValue) anf_interp.ANFValue {
11581158
},
11591159
.boolean => |b| .{ .boolean = b },
11601160
.bytes => |hex| .{ .bytes = hex },
1161+
// FixedArray state fields are expanded into per-index scalar
1162+
// properties before they reach this path, so a raw .array_value
1163+
// here has no representation in the ANF interpreter's scalar
1164+
// value type. Fall through to .none so auto-state computation
1165+
// skips the field instead of trapping the switch.
1166+
.array_value => .{ .none = {} },
11611167
};
11621168
}
11631169

0 commit comments

Comments
 (0)