Skip to content

Commit

Permalink
separate array type handling
Browse files Browse the repository at this point in the history
Signed-off-by: tonykwok1992 <[email protected]>
  • Loading branch information
tonykwok1992 committed Jun 16, 2024
1 parent 3d0a0b2 commit 5c49ed3
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -641,20 +641,34 @@ private List<AbiDefinition.NamedType> extractStructs(
})
.forEach(
namedType -> {
structMap.put(
namedType.flattenNamedType().structIdentifier(), namedType);
if (namedType.getType().startsWith("tuple[")) {
structMap.putIfAbsent(
namedType.flattenNamedType().structIdentifier(), namedType);
} else {
structMap.put(namedType.structIdentifier(), namedType);
}

extractNested(namedType).stream()
.map(this::normalizeNamedType)
.filter(
nestedNamedStruct ->
nestedNamedStruct.getType().startsWith("tuple"))
.forEach(
nestedNamedType ->
structMap.put(
nestedNamedType -> {
if (nestedNamedType
.getType()
.startsWith("tuple[")) {
structMap.putIfAbsent(
nestedNamedType
.flattenNamedType()
.structIdentifier(),
nestedNamedType));
nestedNamedType);
} else {
structMap.put(
nestedNamedType.structIdentifier(),
nestedNamedType);
}
});
});

return structMap.values().stream()
Expand Down

0 comments on commit 5c49ed3

Please sign in to comment.