Skip to content

Conversation

@cristiam86
Copy link
Member

@cristiam86 cristiam86 commented Nov 11, 2025

Fixes #dxp-709

What

Added a new isStudio boolean property to the GenLayerChain type to explicitly distinguish between network types:

Updated chain configurations:
localnet: isStudio: true (uses simulator API)
studionet: isStudio: true (uses simulator API)
testnetAsimov: isStudio: false (uses rollup contract)

Fixed in src/transactions/actions.ts:71: Changed condition from client.chain.id === localnet.id to client.chain.isStudio

Why

to fix a bug where clients were calling the consensus smart contracts when using the studio with other ChainiID

Testing done

  • tested the bug fix

Decisions made

Changed in src/types/chains.ts: Added isStudio: boolean property to GenLayerChain type

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set a descriptive PR title compliant with conventional commits

Summary by CodeRabbit

  • New Features
    • Added isStudio flag to chain configurations for consistent studio environment detection across all chain types.
    • Updated transaction processing to utilize the studio flag for improved environment-aware transaction handling.

@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces an isStudio boolean property to the GenLayerChain type and chain configurations. The property is set to true for localnet and studionet chains. The getTransaction function replaces chain-ID checks with the new isStudio flag to determine Studio-specific transaction handling.

Changes

Cohort / File(s) Change Summary
Type Definition
src/types/chains.ts
Added isStudio: boolean property to GenLayerChain interface
Chain Configurations
src/chains/localnet.ts, src/chains/studionet.ts
Added isStudio: true property to exported chain configuration objects
Transaction Logic
src/transactions/actions.ts
Replaced chain-ID equality check with isStudio flag check in getTransaction; minor formatting adjustments to gasHex and value field handling

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Changes follow a consistent, repetitive pattern across multiple chain configs
  • Single conditional logic refactoring (chain-ID check → flag check) is straightforward
  • Minor formatting adjustments are cosmetic with no behavioral impact

Poem

🐰 A studio flag hops into place,

No more chain-ID chase!

Localnet and studionet aligned,

A cleaner way, redesigned! 🎬✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dxp-709-different-chainids-are-not-considered-using-studio

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 863f050 and ad5af58.

📒 Files selected for processing (4)
  • src/chains/localnet.ts (1 hunks)
  • src/chains/studionet.ts (1 hunks)
  • src/transactions/actions.ts (2 hunks)
  • src/types/chains.ts (1 hunks)

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.

@cristiam86 cristiam86 merged commit 1fa8d4c into main Nov 11, 2025
1 of 2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 3, 2025
4 tasks
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.

2 participants