Skip to content

[Beginner]: Fix copy-paste documentation errors in FileCreateTransaction::setFileMemo #1165

@rwalworth

Description

@rwalworth

🐥 Beginner Friendly

This issue is a great fit for contributors who are ready to explore the Hiero C++
codebase a little more and take on slightly more independent work.

Beginner Issues often involve reading existing C++ code, understanding how
different parts of the SDK fit together, and making small, thoughtful updates
that follow established patterns.

The goal is to support skill growth while keeping the experience approachable,
well-scoped, and enjoyable.


👾 Description of the Issue

The FileCreateTransaction class in

src/sdk/main/include/FileCreateTransaction.h

has a setFileMemo(std::string_view memo) method used to set the memo for a new file. The documentation block for this method contains copy-paste errors from the nearby setContents method.

Currently the docblock says:

  • First line: "Set the memo for the new file. The memo cannot exceed 100 bytes." (correct)
  • @param: "The contents of the new file." (wrong — should describe the memo parameter)
  • @return: "A reference to this FileCreateTransaction object with the newly-set contents." (wrong — should say "newly-set memo")
  • @throws std::invalid_argument: "If the number of bytes exceeds 4096." (wrong — memo has a 100-byte limit, not 4096)

These errors can confuse developers reading the API and may mislead them about validation (e.g. expecting a 4096-byte limit for the memo). Fixing the documentation will align the comments with the actual behavior and with similar setter documentation elsewhere in the SDK.


💡 Proposed Solution

Update the Doxygen comment block for setFileMemo in FileCreateTransaction.h so that:

  • The summary line remains accurate (memo, 100 bytes).
  • @param describes the memo (e.g. "The memo for the new file" or "The new memo for the file").
  • @return refers to the "newly-set memo" (or equivalent) instead of "newly-set contents".
  • @throws std::invalid_argument states the correct constraint (e.g. "If the memo exceeds 100 bytes" or similar, if the SDK enforces this; otherwise omit or align with actual implementation).
  • @throws IllegalStateException line is unchanged (frozen transaction).

No changes to method signatures, implementation, or other files are required. Optionally, compare with setFileMemo in FileUpdateTransaction.h and with other setters in FileCreateTransaction.h for consistent wording and style.


👩‍💻 Implementation Steps

  • Open src/sdk/main/include/FileCreateTransaction.h.
  • Locate the docblock for setFileMemo(std::string_view memo) (near the other file-content and memo setters).
  • Read the docblocks for setContents and setFileMemo in FileUpdateTransaction.h for style reference.
  • Update the setFileMemo docblock:
    • Fix @param to describe the memo (not "contents").
    • Fix @return to say "newly-set memo" (or similar).
    • Fix @throws std::invalid_argument to describe the memo byte limit (e.g. 100 bytes), or remove/align if the implementation does not throw for memo length.
  • Ensure no other part of the file or the method signature is changed.
  • Build the SDK and run relevant tests (e.g. file transaction tests) to confirm nothing is broken.

✅ Acceptance Criteria

To help get this change merged smoothly:

  • Scope: Changes are limited to the setFileMemo documentation in FileCreateTransaction.h.
  • Behavior: No functional or API changes; only comments are updated.
  • Consistency: Wording is consistent with FileUpdateTransaction.h and other setters in the same header.
  • Tests: Existing tests pass (no new tests required for comment-only changes).
  • Review: All code review feedback addressed.

📋 Step-by-Step Contribution Guide

To help keep contributions consistent and easy to review, we recommend following these steps:

  • Comment /assign to request the issue
  • Wait for assignment
  • Fork the repository and create a branch
  • Set up the project using the instructions in README.md
  • Make the requested changes
  • Sign each commit using -s -S
  • Push your branch and open a pull request

Read Workflow Guide for step-by-step workflow guidance.
Read README.md for setup instructions.

❗ Pull requests cannot be merged without S and s signed commits.
See the Signing Guide.


🤔 Additional Information

If you have questions while working on this issue, feel free to ask!

You can reach the community and maintainers here:
Hiero-SDK-C++ Discord

Whether you need help finding the right file, understanding existing code,
or confirming your approach — we're happy to help.

Metadata

Metadata

Assignees

Labels

kind: documentationImprovements or additions to READMEs, guides, API docs, or code commentspriority: lowNon-urgent tasks, nice-to-have improvements, or minor issuesskill: beginnerSuitable for contributors who have completed a good first issue and want to build skills

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions