Skip to content

fix(cli): keep ABI files with the same name separate during graph build - #2187

Open
GeekyKartikey wants to merge 1 commit into
graphprotocol:mainfrom
GeekyKartikey:fix/2182-abi-file-collisions
Open

GeekyKartikey wants to merge 1 commit into
graphprotocol:mainfrom
GeekyKartikey:fix/2182-abi-file-collisions

Conversation

@GeekyKartikey

Copy link
Copy Markdown

Fixes #2182

When a mapping uses both v1/Token.json and v2/Token.json, the build writes them to the same path. The second file overwrites the first, so both entries in the built manifest point to the second ABI.

I kept the original filename for the first file and used Token-2.json for the second. If that name is taken, the compiler tries the next number. References to the same source file can still share a path.

The new test follows each path in the built manifest and checks the file contents for both a data source and a template. It also checks that an unrelated filename stays the same. The test failed before the fix and passes now.

The only failure in the CLI unit tests was the Gnosis start block lookup, which also failed on main.

Would you prefer using the ABI names from the manifest for conflicting files, or does the numbered suffix work for you?

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.

graph build writes ABIs with the same file name to one path, last one wins

1 participant