Skip to content

Commit

Permalink
fix: event signature generation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nicov-iov committed Oct 3, 2024
1 parent 9efd973 commit b7d5336
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/EventCall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,20 @@ export default {
return this.data.inputs
},
eventSignature () {
const { name, inputs } = this
const { name, inputs, space, indexed } = this
const eventName = `${name}`
const eventParams = inputs.map(input => {
const inputDetails = `${input.type} ${input.name}`
return input.indexed ? `${inputDetails} indexed` : inputDetails
const inputType = input.type
const inputName = input.name
let formattedInputLine
if (input.indexed) {
formattedInputLine = `${inputType}${space}${indexed}${space}${inputName}`
} else {
formattedInputLine = `${inputType}${space}${inputName}`
}
return formattedInputLine
})
return `${eventName} (${eventParams.join(', ').trim()})`
Expand Down

0 comments on commit b7d5336

Please sign in to comment.