Skip to content

Commit

Permalink
recursively check parents
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgroul committed Jul 24, 2024
1 parent ebc176f commit 31a4134
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions substrate/substrate-processor/src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,16 @@ export function setUpItems(block: Block): void {
}

if (i < block.calls.length - 1) {
let prev = block.calls[i + 1]
if (isSubcall(prev, rec)) {
rec.parentCall = prev
populateSubcalls(prev, rec)
}
if (prev.parentCall && isSubcall(prev.parentCall, rec)) {
rec.parentCall = prev.parentCall
populateSubcalls(prev.parentCall, rec)
let prev: Call | undefined = block.calls[i + 1]
if (prev.extrinsicIndex == rec.extrinsicIndex) {
while (prev != null) {
if (isSubcall(prev, rec)) {
rec.parentCall = prev
populateSubcalls(prev, rec)
break
}
prev = prev.parentCall
}
}
}
}
Expand Down Expand Up @@ -491,3 +493,8 @@ function isSubcall(parent: CallKey, call: CallKey): boolean {
}
return true
}


function traverseCalls(prev: Call, call: Call) {

}

0 comments on commit 31a4134

Please sign in to comment.