Browse Source

Merge pull request #2777 from Lezek123/giza-query-node-workers-fix

Giza: Fix working groups events processing
Mokhtar Naamani 3 years ago
parent
commit
3d46d0d6b9
1 changed files with 4 additions and 2 deletions
  1. 4 2
      query-node/mappings/workingGroup.ts

+ 4 - 2
query-node/mappings/workingGroup.ts

@@ -94,11 +94,13 @@ export async function workingGroup_TerminatedLeader({ event, store }: EventConte
 /// ///////////////// Helpers ////////////////////////////////////////////////////
 
 function getWorkerType(event: SubstrateEvent): WorkerType | null {
-  if (event.section === 'storageWorkingGroup') {
+  // Note: event.section is not available!
+  const [eventSection] = event.name.split('.')
+  if (eventSection === 'storageWorkingGroup') {
     return WorkerType.STORAGE
   }
 
-  if (event.section === 'gatewayWorkingGroup') {
+  if (eventSection === 'gatewayWorkingGroup') {
     return WorkerType.GATEWAY
   }