@@ -162,29 +162,29 @@ function onMessage(that,dataRes){
162162 }
163163 }
164164 }
165- else if ( data . type === "contract_event" && that . cache [ data . ContractAddress ] !== undefined ) {
166- if ( data . hasOwnProperty ( "ContractEventTopics" ) ) {
167- data . ContractEventTopics . map ( function ( topic , index ) {
168- data . ContractEventTopics [ index ] = "0x" + data . ContractEventTopics [ index ] . toLowerCase ( ) ;
169- } ) ;
170- }
171- if ( data . hasOwnProperty ( "ContractEventInfo" ) && data . ContractEventInfo !== "" ) {
172- data . ContractEventInfo = "0x" + data . ContractEventInfo ;
173- }
174- let key = data . ContractEventTopics [ 0 ] ;
175- if ( that . cache [ key ] ) {
176- let contractObj = that . cache [ data . ContractAddress ] ;
177- let currentEvent = contractObj . options . jsonInterface . find ( function ( json ) {
178- return ( json . type === 'event' && json . signature === '0x' + key . replace ( '0x' , '' ) ) ;
179- } ) ;
180- let output = contractObj . _decodeEventABI ( currentEvent , data ) ;
181- that . cache [ key ] ( null , output ) ;
182- // delete that.cache[key];
183- // let keyIndex = contractObj.registeredEvent.indexOf(key);
184- // contractObj.registeredEvent.splice(keyIndex,1);
185- }
186- }
187165 }
166+ else if ( data . type === "contract_event" && that . cache [ data . ContractAddress ] !== undefined ) {
167+ if ( data . hasOwnProperty ( "ContractEventTopics" ) ) {
168+ data . ContractEventTopics . map ( function ( topic , index ) {
169+ data . ContractEventTopics [ index ] = "0x" + data . ContractEventTopics [ index ] . toLowerCase ( ) ;
170+ } ) ;
171+ }
172+ if ( data . hasOwnProperty ( "ContractEventInfo" ) && data . ContractEventInfo !== "" ) {
173+ data . ContractEventInfo = "0x" + data . ContractEventInfo ;
174+ }
175+ let key = data . ContractEventTopics [ 0 ] ;
176+ if ( that . cache [ key ] ) {
177+ let contractObj = that . cache [ data . ContractAddress ] ;
178+ let currentEvent = contractObj . options . jsonInterface . find ( function ( json ) {
179+ return ( json . type === 'event' && json . signature === '0x' + key . replace ( '0x' , '' ) ) ;
180+ } ) ;
181+ let output = contractObj . _decodeEventABI ( currentEvent , data ) ;
182+ that . cache [ key ] ( null , output ) ;
183+ // delete that.cache[key];
184+ // let keyIndex = contractObj.registeredEvent.indexOf(key);
185+ // contractObj.registeredEvent.splice(keyIndex,1);
186+ }
187+ }
188188}
189189
190190function _isChainsqlType ( data ) {
0 commit comments