--- a/tests/src/util/playgrounds/unique.ts +++ b/tests/src/util/playgrounds/unique.ts @@ -282,12 +282,12 @@ return data.toHuman(); } - public static extractEvents(records: ITransactionResult): IEvent[] { + public static extractEvents(events: {event: any, phase: any}[]): IEvent[] { const parsedEvents: IEvent[] = []; - records.result.events.forEach((record) => { + events.forEach((record) => { const {event, phase} = record; - const types = (event as any).typeDef; + const types = event.typeDef; const eventData: IEvent = { section: event.section.toString(), @@ -505,7 +505,7 @@ let events: IEvent[] = []; try { result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), options, extrinsic) as ITransactionResult; - events = this.eventHelper.extractEvents(result); + events = this.eventHelper.extractEvents(result.result.events); } catch(e) { if(!(e as object).hasOwnProperty('status')) throw e;