capsule-corp-ternoa / ternoa-js

Ternoa JavaScript SDK to build on top of the Ternoa Chain ⚙️
https://docs.ternoa.network
Apache License 2.0
24 stars 10 forks source link

BatchInterruptedEvent : Cannot read properties of undefined (reading 'toString') #56

Closed Evild67 closed 2 years ago

Evild67 commented 2 years ago

I tried to trigger a BatchInterruptedEvent and got an error from the SDK

CleanShot 2022-07-19 at 16 16 29

File : src/events.ts

export class BatchInterruptedEvent extends BlockchainEvent {
[...]
  constructor(event: Event) {
    super(event, EventType.BatchInterrupted)

    this.index = Number.parseInt(event.data[0].toString())
    this.error = event.data[1].toJSON() as {
      module: {
        index: number
        error: string
      }
    }
    this.errorType = event.data[2].toString() // event.data[2] is undefined
    this.details = event.data[3].toString() // event.data[3] is undefined
  }
}

The data is displayed correctly on Polkadot.js.org/apps CleanShot 2022-07-19 at 16 25 40

ipapandinas commented 2 years ago

Hi, thank you for this feedback. This issue is solved in the next release candidate: v1.2.0-rc0. Sorry for the late response.