Skip to content

Fixed runTask returns undefined for eventTrigger problem #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean up and addressed copilot’s comments
  • Loading branch information
chrisli30 committed Jun 17, 2025
commit d2de8bd6403cc51ae7b51a99e13899eca36f9132
9 changes: 0 additions & 9 deletions core/taskengine/run_node_immediately.go
Original file line number Diff line number Diff line change
Expand Up @@ -1717,12 +1717,3 @@ func isExpectedValidationError(err error) bool {
// If it doesn't match validation patterns, treat as system error
return false
}

// getMapKeys returns the keys of a map as a slice for debugging
func getMapKeys(m map[string]interface{}) []string {
keys := make([]string, 0, len(m))
for k := range m {
keys = append(keys, k)
}
return keys
}
7 changes: 1 addition & 6 deletions core/taskengine/vm_runner_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,7 @@ func (r *BranchProcessor) Execute(stepID string, node *avsproto.BranchNode) (*av
}

// Preprocess the expression using the VM's current variable context
processedExpression := condition.Expression
if strings.Contains(processedExpression, "{{") {
processedExpression = r.vm.preprocessTextWithVariableMapping(condition.Expression)
} else {
processedExpression = r.vm.preprocessTextWithVariableMapping(condition.Expression)
}
processedExpression := r.vm.preprocessTextWithVariableMapping(condition.Expression)
log.WriteString("Processed expression for '" + condition.Id + "': " + processedExpression + "\n")

// Check if expression became empty after preprocessing (indicates variable resolution failure)
Expand Down
4 changes: 2 additions & 2 deletions core/taskengine/vm_runner_contract_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ func (r *ContractReadProcessor) buildStructuredData(method *abi.Method, result [
// executeMethodCall executes a single method call and returns the result
func (r *ContractReadProcessor) executeMethodCall(ctx context.Context, contractAbi *abi.ABI, contractAddress common.Address, methodCall *avsproto.ContractReadNode_MethodCall) *avsproto.ContractReadNode_MethodResult {
// Preprocess template variables in method call data
callData := r.vm.preprocessTextWithVariableMapping(methodCall.CallData)
preprocessedCallData := r.vm.preprocessTextWithVariableMapping(methodCall.CallData)
methodName := r.vm.preprocessTextWithVariableMapping(methodCall.MethodName)

calldata := common.FromHex(callData)
calldata := common.FromHex(preprocessedCallData)
msg := ethereum.CallMsg{
To: &contractAddress,
Data: calldata,
Expand Down