From 99d09823aa371048b059a0737cb5e74f35d12ad5 Mon Sep 17 00:00:00 2001 From: Inwon Kim Date: Tue, 29 Aug 2023 14:59:47 +0900 Subject: [PATCH] Fix EventNotification * add logs * fix events assignment --- lib/data/Formatter/EventNotification.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/data/Formatter/EventNotification.ts b/lib/data/Formatter/EventNotification.ts index 9293618..bb8b1e5 100644 --- a/lib/data/Formatter/EventNotification.ts +++ b/lib/data/Formatter/EventNotification.ts @@ -6,15 +6,20 @@ export default class EventNotification { readonly height: BigNumber; readonly index: BigNumber; readonly events: BigNumber[]; + readonly logs: object[]; constructor(data) { this.hash = data.hash; this.height = Converter.toBigNumber(data.height); this.index = Converter.toBigNumber(data.index); + this.events = []; + this.logs = []; if (data.events) { - this.events = []; - for (let i = 0; i < data.events; i++) + for (let i = 0; i < data.events.length; i++) this.events[i] = Converter.toBigNumber(data.events[i]); } + if (data.logs) { + for (let i = 0; i < data.logs.length; i++) this.logs[i] = data.logs[i]; + } } }