Description
The automation_registry::deconstruct_task_metadata() function comment claims "Retrieves specific metadata details of an automation task entry by its task index", but the function neither accepts a task index parameter nor returns the task_index field from the metadata struct. Function signature is incorrect and misleading.
/// Retrieves specific metadata details of an automation task
/// entry by its task index.
public fun deconstruct_task_metadata(
task_metadata: &AutomationTaskMetaData
): (address, vector<u8>, u64, vector<u8>, u64, u64, u64, vector<vector<u8>>, u64, u8, u64)
{
(
// task_metadata.task_index is MISSING
...
task_metadata.state,
task_metadata.locked_fee_for_next_epoch
)
}
Recommendation
Option 1: Fix the function to match comment
Option 2: Fix the comment to match function
Decide on the behaviour of the function and update accordingly.