Skip to content

Comments

refactor: migrate app/util/test/ganache.js to TypeScript#321

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1771446067-migrate-ganache-to-ts
Open

refactor: migrate app/util/test/ganache.js to TypeScript#321
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1771446067-migrate-ganache-to-ts

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Feb 18, 2026

refactor: migrate app/util/test/ganache.js to TypeScript

Summary

Migrates app/util/test/ganache.js to TypeScript (ganache.ts). Key changes:

  • Adds a GanacheStartOptions interface (extending Partial<ServerOptions>) with mnemonic as a required field
  • Explicitly types _server as private _server: Server | undefined
  • Adds return type annotations to all methods
  • Adds null-guard checks for getProvider() in getAccounts() and getBalance() (previously these would throw unclear "cannot read property of undefined" errors)
  • Uses type assertions (as string[], as string) on provider.request() return values

No import path changes were needed — all consumers use extensionless paths (e.g. ../../app/util/test/ganache) that resolve to .ts automatically.

Review & Testing Checklist for Human

  • Verify that Server, ServerOptions, and EthereumProvider are valid exports from the ganache package (they appear in ganache/dist/ganache.d.ts but confirm they resolve at build time)
  • Confirm the GanacheStartOptions interface doesn't conflict with properties already in ServerOptions — several fields (port, blockTime, etc.) are redeclared
  • Verify that the new null-check throws in getAccounts()/getBalance() don't break any existing e2e test flows that might rely on the previous error behavior
  • Check that all consuming files (e2e/fixtures/utils.js, e2e/fixtures/fixture-helper.js, wdio/utils/ganache.js) still resolve the import correctly after the rename

Notes


Open with Devin

Co-Authored-By: shayan@cognition.ai <shayan@cognition.ai>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant