hiero-ledger / hiero-ledger/hiero-sdk-cpp

[Beginner]: Add `operator==` to `PendingAirdropRecord`

Open Beginner friendly
#1,572 9 comments 0 reactions 0 assignees View on GitHub
priority: low scope: api skill: beginner status: ready for dev
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 `PendingAirdropRecord` class is missing an `operator==` implementation.

Relevant files:
```
src/sdk/main/include/PendingAirdropRecord.h
src/sdk/main/src/PendingAirdropRecord.cc
```

`PendingAirdropId` (the type of one of its fields) already has `operator==` — see the recently merged companion PR. `PendingAirdropRecord` wraps a `PendingAirdropId` with an amount and should also support equality comparison.

### 💡 Proposed Solution

Add `operator==` to `PendingAirdropRecord` as a `const` member function:

- Declare `[[nodiscard]] bool operator==(const PendingAirdropRecord& rhs) const` in the header
- Implement it in `PendingAirdropRecord.cc`, comparing both member fields:
- `mPendingAirdropId`, `mAmount`
- Add or extend the unit test file in `src/sdk/tests/unit/PendingAirdropRecordTest.cc`

The change should not affect any existing behavior or public API.

### 👩‍💻 Implementation Steps

- [ ] Open `src/sdk/main/include/PendingAirdropRecord.h` and add the member `operator==` declaration inside the class body
- [ ] Open `src/sdk/main/src/PendingAirdropRecord.cc` and implement `operator==` comparing `mPendingAirdropId` and `mAmount`
- [ ] Open `src/sdk/tests/unit/PendingAirdropRecordTest.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 `PendingAirdropRecord.h`, `PendingAirdropRecord.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

Open the contributing guide

Research direction

Start with src/sdk/main/include/PendingAirdropRecord.h and the existing equality pattern for PendingAirdropId, then inspect src/sdk/main/src/PendingAirdropRecord.cc. Extend src/sdk/tests/unit/PendingAirdropRecordTest.cc with the listed equal and unequal cases, build the SDK, and confirm the existing and new tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.