Skip to content

fix(transactions): expose tx identifier under both hash and txId#167

Open
MuncleUscles wants to merge 1 commit intomainfrom
fix/unify-tx-hash-and-txid
Open

fix(transactions): expose tx identifier under both hash and txId#167
MuncleUscles wants to merge 1 commit intomainfrom
fix/unify-tx-hash-and-txid

Conversation

@MuncleUscles
Copy link
Copy Markdown
Member

Summary

The same on-chain identifier was exposed under different field names depending on which decoder ran:

  • decodeLocalnetTransaction (Studio) only set hash
  • decodeTransaction (testnet) only set txId

This broke any consumer that didn't know which one to read — e.g. genlayer-studio's transactions store kept polling but couldn't match the response back to the in-memory entry, leaving the UI stuck on PENDING on Bradbury.

Both decoders now populate both fields. txId matches the on-chain Solidity struct (source of truth); hash is preserved for back-compat with the legacy localnet RPC shape. The pre-existing // TODO: make localnet compatible with testnet and unify the types comment in types/transactions.ts is replaced with a clarifying note.

Test plan

  • npm test -- --run passes (54 tests)
  • New unit test asserts both fields populated by decodeTransaction
  • Verified end-to-end with genlayer-studio polling on Bradbury (tx 0x663cf5f0... advances PENDING -> ACCEPTED)

The same on-chain identifier was being exposed under different field
names depending on the chain decoder:
- decodeLocalnetTransaction (Studio) only set `hash`
- decodeTransaction (testnet) only set `txId`

This broke any consumer that didn't know which one to read.

Both decoders now populate both fields. `txId` matches the on-chain
Solidity struct (source of truth); `hash` is preserved for
back-compat with the legacy localnet RPC shape.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Warning

Rate limit exceeded

@MuncleUscles has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 13 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c98a8266-bc78-45dd-b712-418b97a26df2

📥 Commits

Reviewing files that changed from the base of the PR and between 66a1d03 and 1c31b91.

📒 Files selected for processing (3)
  • src/transactions/decoders.ts
  • src/types/transactions.ts
  • tests/transactions.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/unify-tx-hash-and-txid

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.

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.

1 participant