Skip to content

Commit

Permalink
fix: Missing args in contract methods awst output
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmenzel committed Jan 8, 2025
1 parent 8b75e04 commit 69052e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/awst/to-code-visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,10 @@ export class ToCodeVisitor
}

visitContractMethod(statement: nodes.ContractMethod): string[] {
const args = statement.args.map((a) => `${a.name}: ${a.wtype}`).join(', ')

const prefix = statement.cref.id === this.currentContract.at(-1)?.id ? '' : `${statement.cref.className}::`
return [`${prefix}${statement.memberName}(): ${statement.returnType}`, '{', ...indent(statement.body.accept(this)), '}', '']
return [`${prefix}${statement.memberName}(${args}): ${statement.returnType}`, '{', ...indent(statement.body.accept(this)), '}', '']
}
visitLogicSignature(moduleStatement: nodes.LogicSignature): string[] {
return ['', `logicsig ${moduleStatement.id} {`, ...indent(moduleStatement.program.body.accept(this)), '}']
Expand Down

0 comments on commit 69052e8

Please sign in to comment.