Skip to content

Test: align nested_container_multi_index with CDT pair/map field names#329

Merged
heifner merged 1 commit into
masterfrom
cleanup/nested-container-test-cdt-abi-names
May 11, 2026
Merged

Test: align nested_container_multi_index with CDT pair/map field names#329
heifner merged 1 commit into
masterfrom
cleanup/nested-container-test-cdt-abi-names

Conversation

@heifner
Copy link
Copy Markdown
Contributor

@heifner heifner commented May 11, 2026

Summary

Wire CDT emits first/second for std::pair and std::map fields in generated ABIs. The previous workaround swapped in a Leap-derived ABI using key/value, but it regressed every time the WASM was regenerated and diverged from Wire CDT's toolchain tests.

This change removes the workaround: the contract ABI uses first/second matching CDT output, and the Python test inputs/assertions are updated to match. WASM is unchanged.

Originally authored as commit 057ba3c on feature/kv-secondary-primary-id. Lifted as a standalone change since it is independent of the KV secondary-index work on that branch.

…d names

Wire CDT emits `first`/`second` for `std::pair` and `std::map` fields in
generated ABIs (see tests/toolchain/abigen-pass/nested_container.abi in
wire-cdt). cc1dde4 previously swapped in a Leap-derived ABI using
`key`/`value` as a workaround, but it regresses every time the WASM is
regenerated and diverges from Wire CDT's own toolchain tests.

Remove the workaround. The contract ABI now uses `first`/`second`
matching CDT output, and the Python test inputs and assertions are
updated to match. The `pvo` case (`pair<uint16_t, vec_op_uint16>`) was
already on `first`/`second` and is unchanged. `transaction_json[...]['value']`
row accessors are untouched - that is the clio RPC envelope field, not
a pair field name.

WASM is unchanged: kv_multi_index binary serialization is positional, so
the field rename is purely a JSON-side concern.
@heifner heifner changed the title Test: align nested_container_multi_index with Wire CDT pair/map field names Test: align nested_container_multi_index with CDT pair/map field names May 11, 2026
@heifner heifner requested review from huangminghuang May 11, 2026 15:23
@heifner heifner merged commit 401ae25 into master May 11, 2026
28 checks passed
@heifner heifner deleted the cleanup/nested-container-test-cdt-abi-names branch May 11, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants