Skip to content

chore: Align the field for mirrornode response with specification - #239

Merged
manishdait merged 8 commits into
hiero-ledger:mainfrom
manishdait:chore/improve-account-info
Aug 22, 2026
Merged

manishdait merged 8 commits into
hiero-ledger:mainfrom
manishdait:chore/improve-account-info

Conversation

@manishdait

@manishdait manishdait commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Description:
This PR align the mirrornode response record to match the nullable/non-nullable fields with the rest api specifications.

Changes Made:

  • Update nullable/non-nullable fields for various entities.

Related issue(s):

Fixes #238

Notes for reviewer:
The .json files only contains the raw json response from the mirrornode api to unit test the parsing.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b609a231-669f-41b0-bb28-a6f810987629

Note

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "path_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

The change aligns response records with nullable Mirror Node fields, updates MicroProfile and Spring JSON conversion, adds timestamp and chunk handling, validates JSON arrays, and adds converter tests with representative fixtures.

Changes

Mirror Node response alignment

Layer / File(s) Summary
Response record contracts
hiero-enterprise-base/src/main/java/org/hiero/base/data/*
Response records now define nullable identifiers, timestamps, numeric values, and optional fields. ChunkInfo removes nonce and scheduled.
MicroProfile JSON conversion and validation
hiero-enterprise-microprofile/src/main/java/.../MirrorNodeJsonConverterImpl.java, hiero-enterprise-microprofile/src/test/java/.../MirrorNodeJsonConverterTest.java, hiero-enterprise-microprofile/src/test/resources/json/*
The converter handles optional fields, precise timestamps, chunked topic messages, custom fees, and invalid array values. Tests and fixtures cover the converted resources.
Spring JSON conversion and validation
hiero-enterprise-spring/src/main/java/.../MirrorNodeJsonConverterImpl.java, hiero-enterprise-spring/src/test/java/.../MirrorNodeJsonConverterTest.java, hiero-enterprise-spring/src/test/resources/json/*
The Spring converter applies the same nullable-field, timestamp, chunk, fee, and array handling. Tests and fixtures cover the supported response types.

Estimated code review effort: 5 (Critical) | ~120 minutes

Mergeability Score: 🟠 High · up to 44772

The current implementation can fail to parse valid Mirror Node responses when nullable fields are absent and can return incorrect binary data by preserving Base64 text instead of decoding it. Because these issues affect runtime behavior in both supported implementations, the PR is not merge-ready until they are corrected.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR aligns nullable response fields and adds fixtures, but it does not add the required AccountInfo fields or HIP-1313 TransactionInfo fields from [#238]. Add the missing AccountInfo fields and HIP-1313 fields to TransactionInfo, with converter support and tests.
Docstring Coverage ⚠️ Warning Docstring coverage is 13.87% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: aligning Mirror Node response fields with the specification.
Description check ✅ Passed The description explains the nullable-field alignment, testing fixtures, and linked issue, which match the changeset.
Out of Scope Changes check ✅ Passed The converter updates, response records, documentation comments, and JSON fixtures all support REST specification alignment and parsing tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@manishdait
manishdait force-pushed the chore/improve-account-info branch 4 times, most recently from 8aac711 to 47fd194 Compare July 14, 2026 19:08
@manishdait manishdait changed the title chore: Added new fields for the account/transaction info chore: Align the field for mirrornode response with specification Aug 1, 2026
@manishdait
manishdait force-pushed the chore/improve-account-info branch 5 times, most recently from eb2a558 to d45373c Compare August 5, 2026 08:28
@manishdait
manishdait marked this pull request as ready for review August 5, 2026 10:43
@manishdait
manishdait requested review from a team as code owners August 5, 2026 10:43
@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Hey @manishdait 👋 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 #238 (assigned to you).


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 8


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d7e2f5e3-d653-4ef1-800f-0af6812fffdf

📥 Commits

Reviewing files that changed from the base of the PR and between 79d835b and 02b7451.

📒 Files selected for processing (57)
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/AccountInfo.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Balance.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Block.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/ChunkInfo.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Contract.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/CustomFee.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/FixedFee.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/FractionalFee.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/RoyaltyFee.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/StakingRewardTransfer.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/TimestampRange.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Token.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/TokenInfo.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/TokenTransfer.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Topic.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/TopicMessage.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Transfer.java
  • hiero-enterprise-microprofile/src/main/java/org/hiero/microprofile/implementation/MirrorNodeJsonConverterImpl.java
  • hiero-enterprise-microprofile/src/test/java/org/hiero/microprofile/test/MirrorNodeJsonConverterTest.java
  • hiero-enterprise-microprofile/src/test/resources/json/account-info.json
  • hiero-enterprise-microprofile/src/test/resources/json/block-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/block.json
  • hiero-enterprise-microprofile/src/test/resources/json/contract-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/contract.json
  • hiero-enterprise-microprofile/src/test/resources/json/exchange-rate.json
  • hiero-enterprise-microprofile/src/test/resources/json/network-fee.json
  • hiero-enterprise-microprofile/src/test/resources/json/network-stake.json
  • hiero-enterprise-microprofile/src/test/resources/json/network-supply.json
  • hiero-enterprise-microprofile/src/test/resources/json/nft-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/nft.json
  • hiero-enterprise-microprofile/src/test/resources/json/token-info.json
  • hiero-enterprise-microprofile/src/test/resources/json/token-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/topic-message-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/topic-message.json
  • hiero-enterprise-microprofile/src/test/resources/json/topic.json
  • hiero-enterprise-microprofile/src/test/resources/json/transaction-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/transaction.json
  • hiero-enterprise-spring/src/main/java/org/hiero/spring/implementation/MirrorNodeJsonConverterImpl.java
  • hiero-enterprise-spring/src/test/java/org/hiero/spring/test/MirrorNodeJsonConverterTest.java
  • hiero-enterprise-spring/src/test/resources/json/account-info.json
  • hiero-enterprise-spring/src/test/resources/json/block-list.json
  • hiero-enterprise-spring/src/test/resources/json/block.json
  • hiero-enterprise-spring/src/test/resources/json/contract-list.json
  • hiero-enterprise-spring/src/test/resources/json/contract.json
  • hiero-enterprise-spring/src/test/resources/json/exchange-rate.json
  • hiero-enterprise-spring/src/test/resources/json/network-fee.json
  • hiero-enterprise-spring/src/test/resources/json/network-stake.json
  • hiero-enterprise-spring/src/test/resources/json/network-supply.json
  • hiero-enterprise-spring/src/test/resources/json/nft-list.json
  • hiero-enterprise-spring/src/test/resources/json/nft.json
  • hiero-enterprise-spring/src/test/resources/json/token-info.json
  • hiero-enterprise-spring/src/test/resources/json/token-list.json
  • hiero-enterprise-spring/src/test/resources/json/topic-message-list.json
  • hiero-enterprise-spring/src/test/resources/json/topic-message.json
  • hiero-enterprise-spring/src/test/resources/json/topic.json
  • hiero-enterprise-spring/src/test/resources/json/transaction-list.json
  • hiero-enterprise-spring/src/test/resources/json/transaction.json

@manishdait
manishdait force-pushed the chore/improve-account-info branch from 78350f5 to 63995ba Compare August 5, 2026 11:12
@hiero-ledger hiero-ledger deleted a comment from coderabbitai Bot Aug 6, 2026
@manishdait
manishdait force-pushed the chore/improve-account-info branch from 63995ba to 024fb8b Compare August 6, 2026 19:35
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 57ff472d-086c-49ee-90b3-6371cffc7a76

📥 Commits

Reviewing files that changed from the base of the PR and between c662da9 and 024fb8b.

📒 Files selected for processing (57)
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/AccountInfo.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Balance.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Block.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/ChunkInfo.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Contract.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/CustomFee.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/FixedFee.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/FractionalFee.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/RoyaltyFee.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/StakingRewardTransfer.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/TimestampRange.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Token.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/TokenInfo.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/TokenTransfer.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Topic.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/TopicMessage.java
  • hiero-enterprise-base/src/main/java/org/hiero/base/data/Transfer.java
  • hiero-enterprise-microprofile/src/main/java/org/hiero/microprofile/implementation/MirrorNodeJsonConverterImpl.java
  • hiero-enterprise-microprofile/src/test/java/org/hiero/microprofile/test/MirrorNodeJsonConverterTest.java
  • hiero-enterprise-microprofile/src/test/resources/json/account-info.json
  • hiero-enterprise-microprofile/src/test/resources/json/block-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/block.json
  • hiero-enterprise-microprofile/src/test/resources/json/contract-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/contract.json
  • hiero-enterprise-microprofile/src/test/resources/json/exchange-rate.json
  • hiero-enterprise-microprofile/src/test/resources/json/network-fee.json
  • hiero-enterprise-microprofile/src/test/resources/json/network-stake.json
  • hiero-enterprise-microprofile/src/test/resources/json/network-supply.json
  • hiero-enterprise-microprofile/src/test/resources/json/nft-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/nft.json
  • hiero-enterprise-microprofile/src/test/resources/json/token-info.json
  • hiero-enterprise-microprofile/src/test/resources/json/token-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/topic-message-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/topic-message.json
  • hiero-enterprise-microprofile/src/test/resources/json/topic.json
  • hiero-enterprise-microprofile/src/test/resources/json/transaction-list.json
  • hiero-enterprise-microprofile/src/test/resources/json/transaction.json
  • hiero-enterprise-spring/src/main/java/org/hiero/spring/implementation/MirrorNodeJsonConverterImpl.java
  • hiero-enterprise-spring/src/test/java/org/hiero/spring/test/MirrorNodeJsonConverterTest.java
  • hiero-enterprise-spring/src/test/resources/json/account-info.json
  • hiero-enterprise-spring/src/test/resources/json/block-list.json
  • hiero-enterprise-spring/src/test/resources/json/block.json
  • hiero-enterprise-spring/src/test/resources/json/contract-list.json
  • hiero-enterprise-spring/src/test/resources/json/contract.json
  • hiero-enterprise-spring/src/test/resources/json/exchange-rate.json
  • hiero-enterprise-spring/src/test/resources/json/network-fee.json
  • hiero-enterprise-spring/src/test/resources/json/network-stake.json
  • hiero-enterprise-spring/src/test/resources/json/network-supply.json
  • hiero-enterprise-spring/src/test/resources/json/nft-list.json
  • hiero-enterprise-spring/src/test/resources/json/nft.json
  • hiero-enterprise-spring/src/test/resources/json/token-info.json
  • hiero-enterprise-spring/src/test/resources/json/token-list.json
  • hiero-enterprise-spring/src/test/resources/json/topic-message-list.json
  • hiero-enterprise-spring/src/test/resources/json/topic-message.json
  • hiero-enterprise-spring/src/test/resources/json/topic.json
  • hiero-enterprise-spring/src/test/resources/json/transaction-list.json
  • hiero-enterprise-spring/src/test/resources/json/transaction.json

Comment thread hiero-enterprise-base/src/main/java/org/hiero/base/data/Topic.java
Comment thread hiero-enterprise-spring/src/test/resources/json/block.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (2)
hiero-enterprise-microprofile/src/main/java/org/hiero/microprofile/implementation/MirrorNodeJsonConverterImpl.java (1)

455-455: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Guard the nullable deleted flag.

Line 455 calls getBoolean("deleted") without a null check. A response with "deleted": null throws and fails the whole conversion. The Spring implementation uses hasNonNull(...) && ... at line 576, so the two modules also disagree.

Proposed fix
-      final boolean deleted = jsonObject.getBoolean("deleted");
+      final boolean deleted =
+          hasNonNull(jsonObject, "deleted") && jsonObject.getBoolean("deleted");
hiero-enterprise-spring/src/main/java/org/hiero/spring/implementation/MirrorNodeJsonConverterImpl.java (1)

605-608: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not convert an absent fee_exempt_key_list into an empty list.

Line 606 hides a malformed response. Based on learnings, GET /api/v1/topics/{topicId} always returns fee_exempt_key_list as an array, including []. Call jsonArrayToStream(node.get("fee_exempt_key_list")) directly. The MicroProfile implementation has the same fallback at lines 491-496.

Source: Learnings


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f8a315cd-8680-40d9-8d7f-c13f7c345087

📥 Commits

Reviewing files that changed from the base of the PR and between 024fb8b and 447723d.

📒 Files selected for processing (2)
  • hiero-enterprise-microprofile/src/main/java/org/hiero/microprofile/implementation/MirrorNodeJsonConverterImpl.java
  • hiero-enterprise-spring/src/main/java/org/hiero/spring/implementation/MirrorNodeJsonConverterImpl.java

@Ndacyayisenga-droid Ndacyayisenga-droid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the great work @manishdait.

the .json files are raw mirror-node responses for parsing tests. Should we expect these to be updated when the REST spec or mirror-node implementation changes?. Am curious to know if tests will break if anything changes in mirror-node responses

@manishdait

Copy link
Copy Markdown
Contributor Author

Thanks for the great work @manishdait.

the .json files are raw mirror-node responses for parsing tests. Should we expect these to be updated when the REST spec or mirror-node implementation changes?. Am curious to know if tests will break if anything changes in mirror-node responses

They are currently hardcoded. so if the mirror spec changes, for eg. if fields are added, removed, or renamed, we would need to update these files accordingly.

Whether the tests break if they are not updated depends on the type of change. so if a field changes from non nullable to nullable, or a non nullable field is renamed/removed, the parsing tests would likely fail. If new fields are added while the existing fields remain unchanged, the tests should generally continue to pass.

Signed-off-by: Manish Dait <daitmanish88@gmail.com>

# Conflicts:
#	hiero-enterprise-microprofile/src/main/java/org/hiero/microprofile/implementation/MirrorNodeJsonConverterImpl.java
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>

# Conflicts:
#	hiero-enterprise-microprofile/src/main/java/org/hiero/microprofile/implementation/MirrorNodeJsonConverterImpl.java
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait
manishdait force-pushed the chore/improve-account-info branch from 447723d to adebf02 Compare August 21, 2026 10:06

@hendrikebbers hendrikebbers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome

Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait
manishdait force-pushed the chore/improve-account-info branch from 458a228 to 2fc7699 Compare August 21, 2026 17:13

@aceppaluni aceppaluni left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@manishdait Awesome job!!

Can you resolve the open conversations for merge? Thank you!!! :)

@aceppaluni aceppaluni added status: merge-ready PR is ready to be merged and removed status: ready-for-review PR is ready to be reviewed by team member labels Aug 21, 2026
@manishdait
manishdait merged commit b8c7b5b into hiero-ledger:main Aug 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: merge-ready PR is ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align fields for mirrornode response to match mirror rest-api specification

4 participants