Skip to content

refactor(worker): replace transaction any types#759

Open
adityabhatkar23 wants to merge 1 commit into
LabsCrypt:mainfrom
adityabhatkar23:refactor/prisma-transaction-client
Open

refactor(worker): replace transaction any types#759
adityabhatkar23 wants to merge 1 commit into
LabsCrypt:mainfrom
adityabhatkar23:refactor/prisma-transaction-client

Conversation

@adityabhatkar23

Copy link
Copy Markdown

Description

Replace any transaction client types in the Soroban event worker with Prisma's generated TransactionClient type to improve compile-time type safety.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or update

Related Issues

Closes #633

Changes Made

  • Added Prisma type imports from the generated Prisma client
  • Replaced tx: any with tx: Prisma.TransactionClient in ensureSystemStream
  • Replaced tx: any with tx: Prisma.TransactionClient in all Prisma transaction callbacks
  • Enabled stronger compile-time validation for transaction-scoped Prisma operations

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Test Steps

  1. Run npm run build
  2. Verify TypeScript compilation succeeds
  3. Confirm all transaction callbacks compile successfully with Prisma.TransactionClient

Breaking Changes

Breaking Changes:

  • None

Migration Guide:

  • No migration required

Screenshots/Demo

N/A

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have checked for breaking changes and documented them if applicable

Additional Notes

  • This is a type-safety refactor only and does not change runtime behavior.
  • Using Prisma.TransactionClient allows TypeScript to validate transaction-scoped Prisma operations and catch typos or invalid model access during compilation.

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.

[Backend] Replace 'tx: any' tx-typing in soroban-event-worker.ts (10 sites)

1 participant