Skip to content

[Beginner]: Build failure in TCK FileService.cc due to FileInfo mAdminKeys API change #1272

@Adityarya11

Description

@Adityarya11

🐥 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

When building the project (specifically the hiero-sdk-cpp-tck target), the compiler throws errors in FileService.cc.

It appears that FileInfo::mAdminKeys is now a value type instead of a pointer, and the TCK code was not updated to reflect this change. Additionally, the protobuf serialization throws an incomplete type error when calling toProtobufKey()->SerializeToString().

Error Logs:

error: base operand of ‘->’ has non-pointer type ‘const Hiero::KeyList’
  199 |   if (!info.mAdminKeys->empty())

error: invalid use of incomplete type ‘class Hiero::proto::Key’
  201 |     response["keys"].push_back(internal::HexConverter::bytesToHex(info.mAdminKeys->toProtobufKey()->SerializeToString()));

Steps To Reproduce:

  1. Configure the CMake project.
  2. Attempt to build the TCK target: cmake --build build/linux-x64-release --target hiero-sdk-cpp-tck (or run a full build).
  3. Observe the compilation failure in FileService.cc.

💡 Proposed Solution

Proposed Fix:
Update the property accessors in FileService.cc around line 203 to use the dot operator and .toBytes() instead of toProtobufKey()->SerializeToString().

// Before
if (!info.mAdminKeys->empty())
{
  response["keys"].push_back(internal::HexConverter::bytesToHex(info.mAdminKeys->toProtobufKey()->SerializeToString()));
}

// After
if (!info.mAdminKeys.empty())
{
  response["keys"].push_back(internal::HexConverter::bytesToHex(info.mAdminKeys.toBytes()));
}

👩‍💻 Implementation Steps

  • Open the FileService.cc file
  • Find the old block of code with
   if (info.mAdminKeys && !info.mAdminKeys->empty())
  {
    auto protoKeyList = info.mAdminKeys->toProtobufKey();
    std::string protoBytes;
    protoKeyList->SerializeToString(&protoBytes);
    response["keys"].push_back(
      internal::HexConverter::bytesToHex(std::vector<std::byte>(protoBytes.begin(), protoBytes.end())));
  }
  • Change it with the proposed fix.

✅ Acceptance Criteria

To help get this change merged smoothly:

  • Scope: Changes are limited to this issue
  • Behavior: No other SDK behavior or API changes
  • Tests: Existing and any new tests pass
  • 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: testingAdding or improving unit tests, integration tests, or test infrastructurepriority: highImportant issue that should be prioritized in the current sprint/releaseskill: beginnerSuitable for contributors who have completed a good first issue and want to build skillsstatus: in progressSomeone is actively working on this issue

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions