Skip to content

Conversation

@yungwine
Copy link
Collaborator

No description provided.

@yungwine yungwine requested a review from Copilot December 22, 2025 10:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment on lines 43 to 46
self.contractsDir: str
self.poolsDir: str
self.tempDir: str
self.nodeName: str
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These instance variables are declared with type hints but not initialized. They should be initialized to None with Optional[str] type hints, or initialized with actual values to avoid potential AttributeError exceptions when accessed before assignment.

Suggested change
self.contractsDir: str
self.poolsDir: str
self.tempDir: str
self.nodeName: str
self.contractsDir: Optional[str] = None
self.poolsDir: Optional[str] = None
self.tempDir: Optional[str] = None
self.nodeName: Optional[str] = None

Copilot uses AI. Check for mistakes.
@yungwine yungwine requested a review from Copilot December 22, 2025 11:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 179 to 182
def about(local, ton, args):
from modules import get_mode, get_mode_settings
if len(args) != 1:
color_print("{red}Bad args. Usage:{endc} about <mode_name>")
if not check_usage_one_arg("about", args):
return
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function parameter name ton is unused in the function body. Consider removing it or prefixing with underscore if required by interface.

Copilot uses AI. Check for mistakes.
"ru": "Остановить работающий коллатор на этой ноде. Используйте без аргументов, чтобы остановить все коллаторы",
"zh_TW": "停止在此節點上運行的協作者。無參數使用以停止所有協作者"
},

Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line 782 creates unnecessary whitespace. This line should be removed to maintain consistent formatting in the JSON file.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 3
import os
import time

from mypylib.mypylib import color_print
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unused import os should be removed as it is no longer used after refactoring.

Copilot uses AI. Check for mistakes.
Comment on lines 99 to +102
try:
poll_addr = args[0]
amount = float(args[1])
except:
color_print("{red}Bad args. Usage:{endc} deposit_to_pool <pool-addr> <amount>")
except ValueError:
color_print("{red}Amount must be a number{endc}")
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message "Amount must be a number" is imprecise. It should specify that the amount must be a valid floating-point number, e.g., "Amount must be a valid number".

Copilot uses AI. Check for mistakes.
return
adnl_addr, shard_str = args
if ':' not in shard_str:
raise Exception(f"Invalid shard: {shard_str}, use format <workchain>:<shard_hex>")
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message uses angle brackets <> inconsistently with the usage format pattern elsewhere in the codebase. For consistency with other usage strings, it should match the established convention (which typically uses angle brackets for required parameters in usage strings but not in error messages).

Suggested change
raise Exception(f"Invalid shard: {shard_str}, use format <workchain>:<shard_hex>")
raise Exception(f"Invalid shard: {shard_str}, use format workchain:shard_hex")

Copilot uses AI. Check for mistakes.
Comment on lines +107 to 112
if not check_usage_args_min_max_len("calculate_annual_controller_percentage", args, min_len=0, max_len=1):
return
if args:
percent_per_round = float(args[0])
except:
else:
percent_per_round = self.ton.GetSettings("max_interest_percent")
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic should be simplified by directly checking if len(args) > 0 instead of using a separate validation that accepts 0 arguments followed by an if args check. Consider using check_usage_args_min_max_len with min_len=0 consistently or refactoring to a clearer validation pattern.

Copilot uses AI. Check for mistakes.
@yungwine yungwine merged commit 54bf61a into ton-blockchain:dev Dec 22, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant