/** * Verify that the worker address is in the selected workers group for the given secret contract address * @param {string} secretContractAddress - Secret contract address * @param {string} workerAddress - Worker address * @param {JSON} params - task epoch params * @return {{isVerified: boolean, error: null}} : isVerified - true if the worker is in the selected group * err - null or Error Class */ _verifySelectedWorker(secretContractAddress, workerAddress, params) { let result = { error: null, isVerified: true }; let selectedWorker = EthereumVerifier.selectWorkerGroup(secretContractAddress, params, 1)[0]; selectedWorker = nodeUtils.remove0x(selectedWorker.toLowerCase()); if (selectedWorker !== workerAddress) { result.error = new errors.WorkerSelectionVerificationErr( "Not the selected worker for the " + secretContractAddress + " task" ); result.isVerified = false; } return result; }