Updated AutomationRecordAction and added unit tests#24
Conversation
| function removeRegisteredTask(uint64 _taskIndex, string memory _reason) external; | ||
|
|
||
| // Entry function to be called by node runtime for bookkeeping | ||
| function removeRegisteredTasks(uint64[] memory _taskIndexes, string[] memory _reasons) external; |
There was a problem hiding this comment.
Earlier it was discussed that multiple tasks could be passed as an argument to remove.
There was a problem hiding this comment.
@udityadav-supraoracles , I think it was later decided to use single task only to avoid any failure due to execution limits due to bulk processing. (CC: @aregng )
| } | ||
| pub fn process_task_indexes(mut self, task_indexes: Vec<u64>) -> Self { | ||
| self.action = Some(AutomationRecordAction::Process(task_indexes)); | ||
| self.action = Some(AutomationRecordAction::process(u64::MAX, task_indexes)); |
There was a problem hiding this comment.
@aregng , not sure I understand why u64::MAX is being passed as cycle_index parameter.
There was a problem hiding this comment.
Builder itself has cycle_index optional parameter with it's corresponding setter method.
But as long as cycle index is a input of the target function, here when task indexes are set, the cycle-index in processTaskCall is initialized with MAX,and when the final transaction is built it is updated with cycle_index property of the builder.
There was a problem hiding this comment.
@aregng , is there a mechanism that catches this and ensure that u64::MAX never remain in the final tx, this is error prone otherwise.
There was a problem hiding this comment.
It was covered by unit tests, but I have updated the builder interface now cycle index is always specified with process or remove action parameters.
| InvalidAutomationRecord(String), | ||
|
|
||
| /// Reported when automation record action can not be decoded from input bytes of the corresponding transaction | ||
| #[error("Failed to decode automation record action: {0}")] |
There was a problem hiding this comment.
Error string here and the option above is exactly the same, is this intended? @aregng
| function removeRegisteredTask(uint64 _taskIndex, string memory _reason) external; | ||
|
|
||
| // Entry function to be called by node runtime for bookkeeping | ||
| function removeRegisteredTasks(uint64[] memory _taskIndexes, string[] memory _reasons) external; |
There was a problem hiding this comment.
@udityadav-supraoracles , I think it was later decided to use single task only to avoid any failure due to execution limits due to bulk processing. (CC: @aregng )
- Now cycle index for automation record will be specified along with action parameters - Fixed property order in InitParams to match the one defined in contract - Added isInitialized binding to check automation registry initialization status
No description provided.