Conversation
|
[commit-verification-bot]
View your commit verification status: Commits Tab. To achieve verified status, please read: Remember, you require a GPG key and each commit must be signed with: Thank you for contributing! From the Hiero Python SDK Team |
WalkthroughAdds a custom TokenId.repr returning "TokenId(shard=X, realm=Y, num=Z)", a unit test for that repr, and a changelog entry documenting the addition. No other behavioral changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/hiero_sdk_python/tokens/token_id.py (1)
20-20: 🧹 Nitpick | 🔵 TrivialConsider setting
repr=Falsesince a custom__repr__is provided.The dataclass decorator has
repr=True, which generates an automatic__repr__. Since a custom implementation is now provided (line 182), the generated one is unused. Settingrepr=Falsewould make the intent clearer and avoid generating dead code.♻️ Suggested change
-@dataclass(frozen=True, eq=True, init=True, repr=True) +@dataclass(frozen=True, eq=True, init=True, repr=False) class TokenId:
Add custom __repr__ method that returns constructor-style representation without the internal checksum field, improving debugging experience. Also add unit tests to verify the __repr__ behavior. Fixes hiero-ledger#1653 Signed-off-by: Chase Naples <Cnaples79@gmail.com>
a253910 to
edbd17b
Compare
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. Quick Fix for CHANGELOG.md ConflictsIf your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:
For all other merge conflicts, please read: Thank you for contributing! |
exploreriii
left a comment
There was a problem hiding this comment.
Aha the tests spotted something wrong!
We have checksums in token id, so we have a test that already checks for them:
test_nft_id
I think we can solve this by adding in the checksum into the repr, so it is not overriden
checksum=None
|
@cnaples79 give me a bit of time please to suggest the best path forward |
|
Hi @cnaples79, thanks for the updates — the PR looks good overall 👍 Once the |
aceppaluni
left a comment
There was a problem hiding this comment.
@cnaples79 Thank you for your work!
Once the changes are made we're happy to re-review.
Please let us know if you need assistance.
|
Hi @cnaples79 |
Summary
__repr__()method forTokenIdclass__repr__()behaviorRationale
__repr__Method forTokenIdClass #1653 requesting a cleaner__repr__for better debugging experience__repr__was showingchecksum=Nonewhich is an internal implementation detailTokenId(shard=0, realm=0, num=123)Changes
src/hiero_sdk_python/tokens/token_id.py: implement__repr__()methodtests/unit/token_id_test.py: addtest_token_id_repr()with multiple test casesCHANGELOG.md: add entry under Unreleased → AddedTest Plan
test_token_id_repr()verifies correct output formatFixes #1653