Skip to content

Commit

Permalink
fix: removing $ from field name when applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Aug 25, 2023
1 parent ec25a8b commit 2eff3da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/codegen/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function generateInterface(

export function findCoreClass(type: string): string | undefined {
for (const coreType of ANTELOPE_CLASSES) {
if (type.split('_').join('') === coreType.toLowerCase()) {
if (type.split('_').join('').replace('$', '') === coreType.toLowerCase()) {
return coreType
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/codegen/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function generateActionNamesInterface(abi: ABI.Def): ts.InterfaceDeclarat

export function generateActionInterface(actionStruct, abi): ts.InterfaceDeclaration {
const members = actionStruct.fields.map((field) => {
console.log({field})
const typeReferenceNode = ts.factory.createTypeReferenceNode(
findParamTypeString(field.type, 'Types.', abi)
)
Expand Down Expand Up @@ -85,5 +86,7 @@ function findParamTypeString(typeString: string, namespace: string | null, abi:
return fieldType.toLowerCase()
}

console.log({fieldType})

return fieldType
}

0 comments on commit 2eff3da

Please sign in to comment.