Skip to content

fix: Rename memo field to topicMemo to eliminate name collision#2477

Merged
MonaaEid merged 5 commits into
hiero-ledger:mainfrom
iron-prog:memo-collision-2473
Jul 26, 2026
Merged

fix: Rename memo field to topicMemo to eliminate name collision#2477
MonaaEid merged 5 commits into
hiero-ledger:mainfrom
iron-prog:memo-collision-2473

Conversation

@iron-prog

Copy link
Copy Markdown
Contributor

Description:

Prevent collisions between topic memos and transaction memos in
TopicCreateTransaction and TopicUpdateTransaction.

  • Store topic memos independently from the base transaction memo
  • Preserve both memos when building protobuf messages

Related issue(s):

Fixes #2473

Notes for reviewer:

  • Added regression tests to verify that topic and transaction memos remain independent.
  • Verified that both memos are correctly serialized into the transaction body.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@iron-prog
iron-prog requested review from a team as code owners July 24, 2026 18:09
@iron-prog
iron-prog requested review from MonaaEid and parvninama July 24, 2026 18:09
Signed-off-by: iron-prog <dt915725@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d88d32dd-0ac1-4d4a-869f-c2086fa5ae67

📥 Commits

Reviewing files that changed from the base of the PR and between 5a14542 and c547a58.

📒 Files selected for processing (4)
  • src/hiero_sdk_python/consensus/topic_create_transaction.py
  • src/hiero_sdk_python/consensus/topic_update_transaction.py
  • tests/unit/topic_create_transaction_test.py
  • tests/unit/topic_update_transaction_test.py

Walkthrough

Topic create and update transactions now store topic-level memos in topic_memo, preventing collisions with the base transaction memo. Unit tests verify independent setter behavior and protobuf serialization.

Changes

Topic memo separation

Layer / File(s) Summary
Separate topic and transaction memo state
src/hiero_sdk_python/consensus/topic_create_transaction.py, src/hiero_sdk_python/consensus/topic_update_transaction.py, tests/unit/topic_create_transaction.py, tests/unit/topic_update_transaction.py
Both transaction types initialize and update topic_memo, map it to the topic protobuf memo field, and test that it remains independent from the transaction-level memo.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the memo-collision fix in topic transactions.
Description check ✅ Passed The description matches the changes to separate topic and transaction memos and adds tests.
Linked Issues check ✅ Passed The PR addresses #2473 by separating topic memos in both TopicCreateTransaction and TopicUpdateTransaction.
Out of Scope Changes check ✅ Passed The changes and tests stay focused on memo-collision fixes without unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #2473

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

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/consensus/topic_update_transaction.py (1)

36-36: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

MAJOR — Make the auto-renew default unset unless explicitly requested.

Proto field: autoRenewPeriod. Issue type: Missing field handling / update semantics. The constructor still defaults auto_renew_period to Duration(7890000), so every TopicUpdate without an explicit auto-renew request serializes that value and can silently overwrite the on-chain value.

Use auto_renew_period: Duration | None = None in the constructor, keep the current guard in _build_proto_body(), and add a test that TopicUpdateTransaction(topic_id).build_transaction_body() does not set autoRenewPeriod.

Source: Path instructions


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b75c7aba-facc-4a10-b74f-9f8ab18ba309

📥 Commits

Reviewing files that changed from the base of the PR and between 2679cb5 and 5a14542.

📒 Files selected for processing (4)
  • src/hiero_sdk_python/consensus/topic_create_transaction.py
  • src/hiero_sdk_python/consensus/topic_update_transaction.py
  • tests/unit/topic_create_transaction_test.py
  • tests/unit/topic_update_transaction_test.py

Comment thread src/hiero_sdk_python/consensus/topic_update_transaction.py Outdated
Comment thread tests/unit/topic_update_transaction_test.py Outdated
Signed-off-by: iron-prog <dt915725@gmail.com>
@iron-prog
iron-prog force-pushed the memo-collision-2473 branch from 5a14542 to aeeaa92 Compare July 24, 2026 18:15
@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels Jul 24, 2026
@manishdait manishdait changed the title Memo collision 2473 fix: Rename memo field to topicMemo to eliminate name collision Jul 25, 2026
- Preserve unset topic memos by storing None instead of collapsing to ""
- Add protobuf regression tests for topic and transaction memo serialization
- Verify unset and empty topic memos serialize correctly

Signed-off-by: iron-prog <dt915725@gmail.com>
@github-actions github-actions Bot added queue:committers PR awaiting committer technical review approved Issue has been approved by team member skill: intermediate requires some knowledge of the codebase with some defined steps to implement or examples and removed queue:junior-committer PR awaiting initial quality review labels Jul 25, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2477   +/-   ##
=======================================
  Coverage   95.27%   95.27%           
=======================================
  Files         164      164           
  Lines       10483    10483           
=======================================
  Hits         9988     9988           
  Misses        495      495           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@exploreriii exploreriii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TopicCreateTransaction.memo and TopicUpdateTransaction.memo now refer to the transaction-level memo, that the topic memo moved to .topic_memo, and that set_memo() / set_transaction_memo() are unaffected — so anyone using the setters, including the TCK handler needs no changes. Only direct attribute access does

@github-actions github-actions Bot added status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge and removed queue:committers PR awaiting committer technical review labels Jul 26, 2026
@MonaaEid
MonaaEid merged commit d18f803 into hiero-ledger:main Jul 26, 2026
28 checks passed
@github-actions

Copy link
Copy Markdown

👋 Hi @iron-prog! Great work completing a Intermediate issue! 🎉

Thanks for your contribution! 🚀

🏆 Milestone unlocked: you've reached Advanced level! 🎉

Here are some issues you might want to explore next:

🌟 Stay connected:

Happy coding! 🚀
— Hiero Python SDK Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Issue has been approved by team member open to community review PR is open for community review and feedback skill: intermediate requires some knowledge of the codebase with some defined steps to implement or examples status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memo collision in TopicCreateTransaction and TopicUpdateTransaction

5 participants