fix: typo in function.kind check#572
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the function-name autocompletion logic for contract function calls by changing how ABI functions are filtered by AbiFunctionKind.
Changes:
- Adjusted the ABI function filter predicate used to build the list of selectable function names.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| .filter(|function| { | ||
| function_kind == AbiFunctionKind::View || function_kind == function.kind | ||
| function.kind == AbiFunctionKind::View || function.kind == function_kind | ||
| }) |
There was a problem hiding this comment.
The filter predicate now always includes AbiFunctionKind::View functions even when input_call_function_name requests AbiFunctionKind::Call. That means the transaction flow will suggest read-only methods too, which contradicts the prompt ("transaction function") and the ABI semantics elsewhere (e.g. inspect labels Call as transaction-required). If the intent is to list functions of the requested kind, the filter should just match function.kind == function_kind (or otherwise explicitly handle each mode).
No description provided.