Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions gittensor/cli/issue_commands/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def admin_cancel(issue_id: int, network: str, rpc_url: str, contract: str, walle

if not issue:
print_error(f'Issue {issue_id} not found on contract.')
return
raise SystemExit(1)

console.print(
Panel(
Expand All @@ -92,6 +92,7 @@ def admin_cancel(issue_id: int, network: str, rpc_url: str, contract: str, walle
print_success(f'Issue {issue_id} cancelled successfully!')
else:
print_error('Cancellation failed.')
raise SystemExit(1)
except Exception as e:
_handle_command_error(e)

Expand Down Expand Up @@ -128,7 +129,7 @@ def admin_payout(issue_id: int, network: str, rpc_url: str, contract: str, walle

if not issue:
print_error(f'Issue {issue_id} not found on contract.')
return
raise SystemExit(1)

console.print(
Panel(
Expand All @@ -147,6 +148,7 @@ def admin_payout(issue_id: int, network: str, rpc_url: str, contract: str, walle
print_success(f'Payout successful! Amount: {format_alpha(result, 4)} ALPHA')
else:
print_error('Payout failed.')
raise SystemExit(1)
except Exception as e:
_handle_command_error(e)

Expand Down Expand Up @@ -189,6 +191,7 @@ def admin_set_owner(new_owner: str, network: str, rpc_url: str, contract: str, w
print_success(f'Ownership transferred to {new_owner}!')
else:
print_error('Ownership transfer failed.')
raise SystemExit(1)
except Exception as e:
_handle_command_error(e)

Expand Down Expand Up @@ -239,6 +242,7 @@ def admin_set_treasury(
)
else:
print_error('Treasury hotkey update failed.')
raise SystemExit(1)
except Exception as e:
_handle_command_error(e)

Expand Down Expand Up @@ -287,6 +291,7 @@ def admin_add_validator(hotkey: str, network: str, rpc_url: str, contract: str,
console.print('[yellow]Possible reasons:[/yellow]')
console.print(' \u2022 Caller is not the contract owner')
console.print(' \u2022 Validator is already whitelisted')
raise SystemExit(1)
except Exception as e:
_handle_command_error(e)

Expand Down Expand Up @@ -336,5 +341,6 @@ def admin_remove_validator(
console.print('[yellow]Possible reasons:[/yellow]')
console.print(' \u2022 Caller is not the contract owner')
console.print(' \u2022 Validator is not in the whitelist')
raise SystemExit(1)
except Exception as e:
_handle_command_error(e)
6 changes: 5 additions & 1 deletion gittensor/cli/issue_commands/mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,17 @@ def issue_harvest(wallet_name: str, wallet_hotkey: str, network: str, rpc_url: s
console.print(f'[cyan]Transaction hash:[/cyan] {result.get("tx_hash", "N/A")}')
print_error(result.get('error', 'Unknown'))
console.print('[dim]Check proxy permissions: contract needs NonCritical proxy.[/dim]')
elif result.get('status') == 'failed':
raise SystemExit(1)
elif result.get('status') in {'failed', 'error'}:
print_error(f'Harvest failed: {result.get("error", "Unknown error")}')
raise SystemExit(1)
else:
console.print(f'\n[yellow]Harvest result: {result}[/yellow]')
raise SystemExit(1)
else:
print_error('Harvest returned None — check logs for details.')
console.print('[dim]Run with --verbose for more information.[/dim]')
raise SystemExit(1)

except ImportError as e:
print_error(f'Missing dependency — {e}')
Expand Down
2 changes: 2 additions & 0 deletions gittensor/cli/issue_commands/vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def val_vote_solution(
print_success('Solution vote submitted!')
else:
print_error('Vote failed.')
raise SystemExit(1)
except Exception as e:
_handle_command_error(e)

Expand Down Expand Up @@ -196,6 +197,7 @@ def val_vote_cancel_issue(
print_success('Cancel vote submitted!')
else:
print_error('Cancel vote failed.')
raise SystemExit(1)
except Exception as e:
_handle_command_error(e)

Expand Down
Loading