Function: replaceOptOutTopNModeler(uint256 _oldModelerIndex, address _newModeler, uint256 _medianPerformanceResults)
This function replaces a modeler in the topNModelers array with a new modeler based on their performance results.
Inputs
_oldModelerIndexControl: Controlled by the caller.
Constraints: Must be less than the length of the
topNModelersarray.Impact: Identifies the index of the modeler to be replaced in the
topNModelersarray.
_newModelerControl: Controlled by the caller.
Constraints: N/A.
Impact: The new modeler to be inserted into the
topNModelersarray.
_medianPerformanceResultsControl: Controlled by the caller.
Constraints: N/A.
Impact: The new index position of the
_newModelerin thetopNModelersarray.
Branches and code coverage
Intended branches
Validation of
_oldModelerIndex.Finding the new index for
_newModelerbased on_medianPerformanceResults.Reordering of the
topNModelersarray and updating themodelerToMedianmapping.
Negative behavior
Revert if
_oldModelerIndexis out of bounds.