Skip to content

feat: add TokenNftTransfer equality operator#1371

Merged
rwalworth merged 1 commit intohiero-ledger:mainfrom
cheese-cakee:feat/1299-token-nft-transfer-operator-eq
Apr 9, 2026
Merged

feat: add TokenNftTransfer equality operator#1371
rwalworth merged 1 commit intohiero-ledger:mainfrom
cheese-cakee:feat/1299-token-nft-transfer-operator-eq

Conversation

@cheese-cakee
Copy link
Copy Markdown
Member

Description

This PR adds operator== support to TokenNftTransfer and unit coverage for equality behavior, following the existing SDK value-type pattern.

Related Issue

What Changed

  • Added friend equality declaration to:
    • src/sdk/main/include/TokenNftTransfer.h
  • Implemented equality operator in:
    • src/sdk/main/src/TokenNftTransfer.cc
  • Extended unit tests in:
    • src/sdk/tests/unit/TokenNftTransferUnitTests.cc

Equality compares exactly these fields:

  • mNftId
  • mSenderAccountId
  • mReceiverAccountId
  • mIsApproval

Test Coverage Added

  • Two default-constructed instances are equal
  • Two identically-constructed instances are equal
  • Instances with different mNftId are not equal
  • Instances with different mSenderAccountId are not equal
  • Instances with different mReceiverAccountId are not equal
  • Instances with different mIsApproval are not equal

Notes

  • Scope is limited to the issue-requested files only.
  • No API behavior changes beyond adding equality support for TokenNftTransfer.

Signed-off-by: cheese-cakee <farzanaman99@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Hey @cheese-cakee 👋 thanks for the PR!
I'm your friendly PR Helper Bot 🤖 and I'll be riding shotgun on this one, keeping track of your PR's status to help you get it approved and merged.

This comment updates automatically as you push changes -- think of it as your PR's live scoreboard!
Here's the latest:


PR Checks

DCO Sign-off -- All commits have valid sign-offs. Nice work!


GPG Signature -- All commits have verified GPG signatures. Locked and loaded!


Merge Conflicts -- No merge conflicts detected. Smooth sailing!


Issue Link -- Linked to #1299 (assigned to you).


🎉 All checks passed! Your PR is ready for review. Great job!

@github-actions github-actions bot added the status: needs review The pull request is ready for maintainer review label Apr 9, 2026
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 10 complexity · 0 duplication

Metric Results
Complexity 10
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Copy link
Copy Markdown
Contributor

@rwalworth rwalworth left a comment

Choose a reason for hiding this comment

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

LGTM - the implementation is clean and correct, and the test coverage is solid. Left one small nitpick below on test naming, but nothing blocking. Running the workflows now and will merge once they pass!

@rwalworth rwalworth merged commit a3dd653 into hiero-ledger:main Apr 9, 2026
16 of 17 checks passed
@rwalworth rwalworth removed the status: needs review The pull request is ready for maintainer review label Apr 9, 2026
@cheese-cakee
Copy link
Copy Markdown
Member Author

Sorry I couldn't get back to solve the test naming issue on time! Thanks for merging tho :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Beginner]: Add operator== to TokenNftTransfer

2 participants