Skip to content

Commit

Permalink
Merge branch 'feat/DV-275/events-display-format' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
nicov-iov committed Oct 3, 2024
2 parents 501d5d0 + b7d5336 commit a1f02e8
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 a1f02e8

Please sign in to comment.