Skip to content

Conversation

@AndreMiras
Copy link
Contributor

When generating test files with --index-events, the entity ID format was using the old string concatenation format ('-1') instead of the format produced by concatI32() ('01000000'). This caused all generated tests to fail out-of-the-box.

Changes:

  • Update entity ID in test assertions from '-1' to '01000000' format
  • Improve comment to explain concatI32() encoding with little-endian bytes
  • Correct terminology from "default address" to "default transaction hash"

This fixes a bug introduced in commit 34aee49 (Oct 2022) when Bytes as ID with @immutable was implemented. The mapping and schema templates were updated but the test template was missed.

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2025

🦋 Changeset detected

Latest commit: 882bfb6

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

@YaroShkvorets
Copy link
Collaborator

Thanks for the PR!

@YaroShkvorets YaroShkvorets self-requested a review October 25, 2025 03:53
AndreMiras and others added 6 commits October 24, 2025 23:58
When generating test files with --index-events, the entity ID format was
using the old string concatenation format ('-1') instead of the format
produced by concatI32() ('01000000'). This caused all generated tests to
fail out-of-the-box.

Changes:
- Update entity ID in test assertions from '-1' to '01000000' format
- Improve comment to explain concatI32() encoding with little-endian bytes
- Correct terminology from "default address" to "default transaction hash"

This fixes a bug introduced in commit 34aee49 (Oct 2022) when Bytes as ID
with @immutable was implemented. The mapping and schema templates were
updated but the test template was missed.
@YaroShkvorets YaroShkvorets force-pushed the feature/fix-scaffold-test-entity-id-format branch from 53180f8 to 882bfb6 Compare October 25, 2025 04:01
@YaroShkvorets YaroShkvorets merged commit 921c014 into graphprotocol:main Oct 25, 2025
8 checks passed
@AndreMiras AndreMiras deleted the feature/fix-scaffold-test-entity-id-format branch October 25, 2025 06:37
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