Skip to content

Commit

Permalink
fix for tuple base type
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteenkamp89 committed Apr 11, 2024
1 parent 06316c3 commit 025412a
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/plugins/oSnap/components/Input/MethodParameter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ function reduceInt(type: string) {
const inputType = computed(() => {
const baseType = props.parameter.baseType;
if (baseType === 'tuple') {
return {
input: 'tuple',
type: props.parameter.components.map(
item => reduceInt(item.baseType) as InputTypes
)
// ["string","int","address"]
} as const;
}
if (baseType === 'array') {
if (props.parameter.type.includes('tuple')) {
return {
input: 'tuple',
type: props.parameter.components.map(
item => reduceInt(item.baseType) as InputTypes
)
// ["string","int","address"]
} as const;
} else {
return {
input: 'array',
type: reduceInt(props.parameter.arrayChildren.baseType) as InputTypes
} as const;
}
return {
input: 'array',
type: reduceInt(props.parameter.arrayChildren.baseType) as InputTypes
} as const;
}
return { type: reduceInt(baseType) as InputTypes, input: 'single' } as const;
Expand Down

0 comments on commit 025412a

Please sign in to comment.