Skip to content

Commit

Permalink
no longer checking for none since autotx params are always defined
Browse files Browse the repository at this point in the history
  • Loading branch information
nerfZael committed Jun 11, 2024
1 parent d393fd3 commit 9e51b92
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions autotx/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ async def create_task(task: models.TaskCreate, background_tasks: BackgroundTasks
tasks = db.TasksRepository(app.id)

global autotx_params
if autotx_params is None:
raise HTTPException(status_code=500, detail="AutoTx not started")

if not autotx_params.is_dev and (not task.address or not task.chain_id):
raise HTTPException(status_code=400, detail="Address and Chain ID are required for non-dev mode")

Expand Down Expand Up @@ -184,14 +181,10 @@ def send_transactions(task_id: str, model: models.SendTransactionsParams, author

agent = Account.from_key(agent_private_key)


global autotx_params
if autotx_params is None:
raise HTTPException(status_code=500, detail="AutoTx not started")

if task.transactions is None or len(task.transactions) == 0:
raise HTTPException(status_code=400, detail="No transactions to send")

global autotx_params
if autotx_params.is_dev:
print("Dev mode: skipping transaction submission")
db.submit_transactions(app.id, model.address, model.chain_id, app_user.id, task_id)
Expand Down

0 comments on commit 9e51b92

Please sign in to comment.