-
Notifications
You must be signed in to change notification settings - Fork 433
fix: improve code quality and error handling #3193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: improve code quality and error handling #3193
Conversation
wnqqnw19
commented
Dec 5, 2025
…e 3.1.0 with its hotkeypub changes.
…g (such as is the case with BadOrigin) while retaining the list join for non-strings.
…/bump-bt-wallet Bump bittensor-wallet version
…rror-formatter Format Error with string docs
…ect-parrent-init `LoggingMachine` initialization updated to explicitly call both parent constructors
…ding-in-dynamic-info Fixed `moving_price` conversion from `I96F32` to float
…-crv3-logic Add new CRv4 logic
…ix-test-breakages UV Fix
Update changelog + version
…rand-major-version Major version locks drand
…/update-type-hints-ws-shutdown-timer Update type hint/docstring for ws_shutdown_timer
…rnance-deadcode Commenting on the test until the new governance come
Bumping scalecodec to 1.2.12
Bumping version 9.12.1 + changelog
Release/v9.12.1
* Use uv pip for e2e dependency installation (opentensor#3109) * improve `subtensor.get_liquidity_list` * update `test_liquidity` (non functional) * add storage_keys * fix unit tests * apply default era.period to all extrinsics * apply default era.period to all subtensor extrinsic calls * fix *do tests * replace sn0 owner keys * Allow python 3.14 (opentensor#3122) * 9.12.2: changelog + version (opentensor#3125) changelog + version --------- Co-authored-by: Roman Chkhaidze <[email protected]> Co-authored-by: Roman <[email protected]>
…w-e2e-tests Improve e2e tests workflow
basfroman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls apply comments related changes and pull SDKv10 branch since that one is updated now. Then, I review this PR once more.
Thank you for contribution!
bittensor/core/errors.py
Outdated
| # redundant aliases | ||
| SubstrateRequestException = SubstrateRequestException | ||
| StorageFunctionNotFound = StorageFunctionNotFound | ||
| BlockNotFound = BlockNotFound | ||
| ExtrinsicNotFound = ExtrinsicNotFound | ||
| # Re-export exceptions from async_substrate_interface for convenience | ||
| # These are already imported above, no need for redundant aliases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all of this and add __all__ in the end of the file
__all__ = [
"BalanceTypeError",
"BalanceUnitMismatchError",
"BlacklistedException",
"BlockNotFound",
"ChainConnectionError",
"ChainError",
"ChainQueryError",
"ChainTransactionError",
"DelegateTakeTooHigh",
"DelegateTakeTooLow",
"DelegateTxRateLimitExceeded",
"DuplicateChild",
"ExtrinsicNotFound",
"HotKeyAccountNotExists",
"IdentityError",
"InternalServerError",
"InvalidChild",
"InvalidRequestNameError",
"MaxAttemptsException",
"MaxSuccessException",
"MetadataError",
"NominationError",
"NonAssociatedColdKey",
"NotDelegateError",
"NotEnoughStakeToSetChildkeys",
"NotRegisteredError",
"NotVerifiedException",
"PostProcessException",
"PriorityException",
"ProportionOverflow",
"RegistrationError",
"RegistrationNotPermittedOnRootSubnet",
"RunException",
"StakeError",
"StorageFunctionNotFound",
"SubnetNotExists",
"SubstrateRequestException",
"SynapseDendriteNoneException",
"SynapseException",
"SynapseParsingError",
"TakeError",
"TooManyChildren",
"TransferError",
"TxRateLimitExceeded",
"UnknownSynapseError",
"UnstakeError",
]There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll do that. Thank you for your feedback
| if _version_match is None: | ||
| raise ValueError(f"Invalid version format: {__version__}. Expected format: X.Y.Z") | ||
| __version__ = _version_match.group(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially, with or without your update, we'll know the version might be broken. But your approach is more obvious. I like it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @basfroman, thanks for the review!
- I've updated my branch with the latest SDKv10
- Removed the redundant aliases in errors.py
- Added the full all list at the end of the file as requested
Everything should now match your review comments, I think. Let me know if anything else needs adjustment!
bittensor/core/errors.py
Outdated
| # Re-export exceptions from async_substrate_interface for convenience | ||
| # These are already imported above, no need for redundant aliases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments and fix RP checkers issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the comments and PR checkers issues as requested. Thanks for your feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebased your pr to SDKv10 branch.
I guess you want to re-create the PR for SDKv10 instead of solving the conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @basfroman thanks for rebasing!
I've created a fresh PR #3198 [ Fix/code quality improvements sdkv10 ] targeting SDKv10 as you suggested.