Skip to content

fix(cli): preserve fixed array and unsigned value kinds - #2178

Open
yinbowen-dc wants to merge 1 commit into
graphprotocol:mainfrom
yinbowen-dc:codex/fix-1104-fixed-array-values
Open

yinbowen-dc wants to merge 1 commit into
graphprotocol:mainfrom
yinbowen-dc:codex/fix-1104-fixed-array-values

Conversation

@yinbowen-dc

Copy link
Copy Markdown

Generated Ethereum call arguments now preserve fixed-size array dimensions and unsigned small-integer element kinds instead of passing dynamic/signed values to the host ABI encoder.

Fixes #1104

ethereumFromAsc recursively converts affected arrays, selecting fromFixedSizedArray or fromArray at each dimension and reusing scalar conversions at the leaves. This covers fixed/dynamic mixtures and uint8/16/24 arrays, while keeping existing scalar and unaffected dynamic-array output. Generated code only uses already available graph-ts APIs. Includes a CLI patch changeset.

Validation:

  • 104 related codegen tests passed.
  • 19 new runtime tests compile generated expressions with the actual AssemblyScript compiler and graph-ts sources, then instantiate and execute the WebAssembly. Cases cover array nesting, fixed/dynamic dimensions, signed/unsigned integers, address, bytes/fixed-bytes, string, and a generated-style tuple subclass; integer values are checked as well as ValueKind tags.
  • Before the fix, 14 of the original 16 runtime kind cases failed; the 2 unaffected dynamic-array controls passed.
  • Existing exact generated-source expectations were updated for the corrected expressions.
  • CLI build and latest TypeScript compilation, scoped ESLint/Prettier, and git diff --check passed.

The test host only provides abort and the unused integer-overflow diagnostic hook; it does not mock the value conversions. No live RPC, graph-node deployment, or on-chain transaction was used. Full network-dependent integration tests were not run.

Prepared with Codex AI assistance; no human review is claimed.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9268ec5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

Codegen for fixed size array solidity parameters incorrect

1 participant