Skip to content

Commit

Permalink
codegen: fix duplicate ID bug (#1891)
Browse files Browse the repository at this point in the history
fixes #1604

* fix codegen output class name duplicates

* changeset
  • Loading branch information
YaroShkvorets authored Jan 8, 2025
1 parent f6079a6 commit d1fa5e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/blue-insects-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphprotocol/graph-cli': patch
---

fix bug with duplicate IDs - #1604
3 changes: 2 additions & 1 deletion packages/cli/src/protocols/ethereum/codegen/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ export default class AbiCodeGenerator {
}

const tupleIdentifier = parentClass + tsCodegen.namedType(name).capitalize();
const tupleClassName = tupleIdentifier + 'Struct';
const tupleClassName =
tupleIdentifier + (parentField === 'outputValues' ? 'Output' : '') + 'Struct';
let tupleClasses: any[] = [];

const isTupleType = util.isTupleType(type);
Expand Down

0 comments on commit d1fa5e0

Please sign in to comment.