hiero-ledger / hiero-ledger/hiero-sdk-cpp
[Beginner]: Add `operator==` to `ScheduleInfo`
- Dominant language
- C++
- Stars
- 42
- Forks
- 108
- Avg merge
- 11h 45m
- Merged PRs (30d)
- 2
Description
### 🐥 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.
> [!IMPORTANT]
> ### 🐥 About Beginner Issues
>
> Beginner Issues are a great next step for contributors who feel comfortable with the basic project workflow and want to explore the codebase a little more.
>
> These issues often involve:
> - Reading existing C++ code
> - Understanding how different parts of the SDK fit together
> - Making small, thoughtful updates that follow established patterns
>
> You'll usually see Beginner Issues focused on things like:
> - Small, well-scoped improvements to existing tests
> - Narrow updates to `src` functionality (e.g. refining helpers or improving readability)
> - Documentation or comment clarity
> - Enhancements to existing examples
>
> Other types of contributions — such as brand-new features, broader system changes, or deeper technical work — are just as valuable and may use different labels.
### 👾 Description of the Issue
The `ScheduleInfo` class is missing an `operator==` implementation.
Relevant files:
```
src/sdk/main/include/ScheduleInfo.h
src/sdk/main/src/ScheduleInfo.cc
```
Without `operator==`, callers must compare schedule info objects field-by-field. Other SDK value types (e.g. `ScheduleId`, `AccountId`, `PendingAirdropId`) already implement `operator==` as a pattern — `ScheduleInfo` should follow suit.
### 💡 Proposed Solution
Add `operator==` to `ScheduleInfo` as a `const` member function:
- Declare `[[nodiscard]] bool operator==(const ScheduleInfo& rhs) const` in the header
- Implement it in `ScheduleInfo.cc`, comparing all meaningful member fields:
- `mScheduleId`, `mExecutionTime`, `mDeletionTime`, `mExpirationTime`
- `mScheduledTransaction`, `mMemo`, `mSignatories`
- `mCreatorAccountId`, `mPayerAccountId`, `mScheduledTransactionId`
- `mLedgerId`, `mWaitForExpiry`
- Note: `mAdminKey` is a `std::shared_ptr` — compare by pointer identity or omit it if that is the established convention for key fields; confirm with a maintainer if unsure
- Add or extend the unit test file in `src/sdk/tests/unit/ScheduleInfoTest.cc`
The change should not affect any existing behavior or public API.
### 👩💻 Implementation Steps
- [ ] Open `src/sdk/main/include/ScheduleInfo.h` and add the member `operator==` declaration inside the class body
- [ ] Open `src/sdk/main/src/ScheduleInfo.cc` and implement `operator==` comparing all member fields listed above
- [ ] Open `src/sdk/tests/unit/ScheduleInfoTest.cc` and add equality tests:
- Two default-constructed instances are equal
- Two identically-constructed instances are equal
- Instances differing in each field are not equal
- [ ] Build the SDK and confirm all tests pass
### ✅ Acceptance Criteria
- [ ] **Scope:** Changes are limited to `ScheduleInfo.h`, `ScheduleInfo.cc`, and its unit test
- [ ] **Behavior:** No other SDK behavior or API changes
- [ ] **Tests:** Existing and new equality 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](https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/docs/training/workflow.md) for step-by-step workflow guidance.
Read [README.md](https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/README.md) for setup instructions.
❗ Pull requests **cannot be merged** without `S` and `s` signed commits.
See the [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/docs/training/signing.md).
### 🤔 Additional Information
Declare `operator==` as a `const` member function — not a `friend`. The declaration in the header is `[[nodiscard]] bool operator==(const T& rhs) const;` and the definition in the `.cc` file uses `mField` directly (not `lhs.mField`) since `this` is the left-hand side.
If you have questions while working on this issue, feel free to ask! [Hiero-SDK-C++ Discord](https://discord.com/channels/905194001349627914/1337424839761465364)
Contributor guide
Research direction
Start with src/sdk/main/include/ScheduleInfo.h and src/sdk/main/src/ScheduleInfo.cc, then review operator== implementations for ScheduleId, AccountId, and PendingAirdropId. Add the const member comparison using the listed fields, confirming the mAdminKey convention with a maintainer. Extend src/sdk/tests/unit/ScheduleInfoTest.cc for equal and differing instances, then build the SDK and run the tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100