From 515ab776c695e48b42c8fb89b472ccf28c15f239 Mon Sep 17 00:00:00 2001 From: mguleryuz Date: Tue, 17 Dec 2024 10:54:56 +0000 Subject: [PATCH] chore(qf): compiler checks for name and output --- tools/compile/extendAbi.ts | 4 ++-- tools/compile/updateAbiOutputNames.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/compile/extendAbi.ts b/tools/compile/extendAbi.ts index e4b0ff7..28907c8 100644 --- a/tools/compile/extendAbi.ts +++ b/tools/compile/extendAbi.ts @@ -35,8 +35,8 @@ function extend( ): AbiParameter | ExtendedAbiParameter { const { descriptions, tags: sotTags } = abiMemberMeta - // 0- Check if the parameter has a name else return the parameter unchanged - if (!parameter.name) return parameter + // 0- Check if the parameter is defined and has a name else return the parameter unchanged + if (!parameter || !parameter.name) return parameter const name = parameter.name diff --git a/tools/compile/updateAbiOutputNames.ts b/tools/compile/updateAbiOutputNames.ts index a597885..b7033d5 100644 --- a/tools/compile/updateAbiOutputNames.ts +++ b/tools/compile/updateAbiOutputNames.ts @@ -22,7 +22,10 @@ export default function (abi: Abi, abiMemberMetas: AbiMemberMetas) { // 7- Update the outputs of the member with the nameWithIndexArr const updatedOutputs = nameWithIndexArr.map(({ index, name }) => { const output = (abi[memberIndex] as any)?.outputs[index] - output.name = name + + if (output) { + output.name = name + } return output })