Skip to content

feat: include genesisBlockHash in version endpoint response#385

Merged
andreabadesso merged 1 commit intomasterfrom
feat/version-endpoint-genesis-block-hash
Mar 17, 2026
Merged

feat: include genesisBlockHash in version endpoint response#385
andreabadesso merged 1 commit intomasterfrom
feat/version-endpoint-genesis-block-hash

Conversation

@andreabadesso
Copy link
Copy Markdown
Collaborator

@andreabadesso andreabadesso commented Mar 17, 2026

Motivation

The /version endpoint was dropping genesis_block_hash from the fullnode response during conversion. The mobile wallet needs this field to persist registered tokens per network across network changes.

Acceptance Criteria

  • /version endpoint response includes genesisBlockHash field
  • genesisBlockHash is null when the fullnode does not provide it (older versions)
  • Existing fields in the response are unchanged

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged
  • Make sure either the unit tests and/or the QA tests are capable of testing the new features
  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

Summary by CodeRabbit

  • New Features
    • Added genesis block hash information to fullnode version data, enabling enhanced blockchain verification and identification capabilities within the wallet service.

The convertApiVersionData function was dropping the genesis_block_hash
field from the fullnode response. This field is needed by the mobile
wallet to persist registered tokens per network across network changes.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5d5d3e35-136e-4884-95fe-b21c9c6fe59f

📥 Commits

Reviewing files that changed from the base of the PR and between 1693af7 and 07328e1.

📒 Files selected for processing (3)
  • packages/wallet-service/src/nodeConfig.ts
  • packages/wallet-service/src/types.ts
  • packages/wallet-service/tests/nodeConfig.test.ts

📝 Walkthrough

Walkthrough

A new optional field genesisBlockHash is added to the FullNodeVersionData type. The convertApiVersionData function is updated to map the API's genesis_block_hash field to this new field, defaulting to null when absent. Tests are updated to verify the mapping behavior.

Changes

Cohort / File(s) Summary
Type Definition
packages/wallet-service/src/types.ts
Added genesisBlockHash: string | null field to the FullNodeVersionData interface.
Implementation & Tests
packages/wallet-service/src/nodeConfig.ts, packages/wallet-service/tests/nodeConfig.test.ts
Updated convertApiVersionData function to map genesis_block_hash to genesisBlockHash, defaulting to null when absent. Test cases updated to verify the new field is properly included in the return value.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A genesis block hash now shines so bright,
Through types and tests, we map it just right!
With null as default, it flows with such grace,
This tiny addition finds its perfect place! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and concisely describes the main change: adding genesisBlockHash to the version endpoint response, which matches the core objective of including this field in the API response.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/version-endpoint-genesis-block-hash
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

@andreabadesso andreabadesso self-assigned this Mar 17, 2026
@andreabadesso andreabadesso added the enhancement New feature or request label Mar 17, 2026
@andreabadesso andreabadesso moved this from Todo to In Progress (Done) in Hathor Network Mar 17, 2026
@pedroferreira1 pedroferreira1 moved this from In Progress (Done) to In Review (WIP) in Hathor Network Mar 17, 2026
@andreabadesso andreabadesso merged commit 83801a9 into master Mar 17, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Mar 17, 2026
@andreabadesso andreabadesso deleted the feat/version-endpoint-genesis-block-hash branch March 17, 2026 14:28
@andreabadesso andreabadesso moved this from Waiting to be deployed to Done in Hathor Network Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants