Skip to content

Commit

Permalink
fix enums
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Jul 12, 2024
1 parent 26c8bd3 commit 878e256
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/common/src/codegen/render-solidity/renderEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ type Enums = {
* Render a list of enum data as solidity enum definitions
*/
export function renderEnums(enums: Enums): string {
return `
${renderedSolidityHeader}
${Object.entries(enums).map(
([name, values]) => `
const enumDefinitions = Object.entries(enums).map(
([name, values]) => `
enum ${name} {
${values.join(", ")}
}
`,
)}
);

return `
${renderedSolidityHeader}
${enumDefinitions.join("")}
`;
}

0 comments on commit 878e256

Please sign in to comment.