Skip to content

Commit

Permalink
[Fixes 4035] Add the code to the ModuleInvocationContext.
Browse files Browse the repository at this point in the history
  • Loading branch information
scr-oath committed Nov 4, 2024
1 parent a788661 commit 7d25cdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions hooks/hookexecution/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func executeGroup[H any, P any](

for _, hook := range group.Hooks {
mCtx := executionCtx.getModuleContext(hook.Module)
mCtx.HookImplCode = hook.Code
newPayload := handleModuleActivities(hook.Code, executionCtx.activityControl, payload, executionCtx.account)
wg.Add(1)
go func(hw hooks.HookWrapper[H], moduleCtx hookstage.ModuleInvocationContext) {
Expand Down
2 changes: 2 additions & 0 deletions hooks/hookstage/invocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type ModuleInvocationContext struct {
Endpoint string
// ModuleContext holds values that the module passes to itself from the previous stages.
ModuleContext ModuleContext
// HookImplCode is the hook_impl_code for a module instance to differentiate between multiple hooks
HookImplCode string
}

// ModuleContext holds arbitrary data passed between module hooks at different stages.
Expand Down

0 comments on commit 7d25cdb

Please sign in to comment.