(self, task_id, keyword: str)
| 211 | |
| 212 | @error_wrapper |
| 213 | async def validate_task(self, task_id, keyword: str) -> bool: |
| 214 | payload = {'keyword': keyword} |
| 215 | resp = await self.post(f'{self.earn_domain}/api/v1/tasks/{task_id}/validate', data=payload) |
| 216 | resp_json = await resp.json() |
| 217 | if resp_json.get('status') == "READY_FOR_CLAIM": |
| 218 | return True |
| 219 | if resp_json.get('message') == "Incorrect task keyword": |
| 220 | return False |
| 221 | self._log.error(f"validate_task error: {resp_json}") |
| 222 | |
| 223 | @error_wrapper |
| 224 | async def claim_task(self, task_id): |
no test coverage detected