Skip to content

Revert and removing getting transaction hash within send function#178

Merged
RanaBug merged 1 commit into
masterfrom
fix/PRO-3119/transaction-hash-sent-batch
Mar 12, 2025
Merged

Revert and removing getting transaction hash within send function#178
RanaBug merged 1 commit into
masterfrom
fix/PRO-3119/transaction-hash-sent-batch

Conversation

@RanaBug
Copy link
Copy Markdown
Collaborator

@RanaBug RanaBug commented Mar 12, 2025

Description

  • Revert and removing getting transaction hash within send function

How Has This Been Tested?

  • Unit Tests and Manual Testing

Screenshots (if appropriate):

Types of changes

  • 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 change)

Summary by CodeRabbit

  • Chores
    • Updated the package version to 1.0.4 and refreshed the changelog.
  • Refactor
    • Streamlined transaction processing by removing a now-unneeded parameter and making certain identifiers optional for improved clarity.
  • Tests
    • Cleaned up test code by removing obsolete timer configurations and unnecessary comments.

@RanaBug RanaBug requested a review from IAmKio March 12, 2025 16:41
@RanaBug RanaBug self-assigned this Mar 12, 2025
@linear
Copy link
Copy Markdown

linear Bot commented Mar 12, 2025

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 12, 2025

Walkthrough

This pull request updates the package version from 1.0.3 to 1.0.4 and revises the changelog to document the update. In the provider component, the send() method has been modified to remove the transaction hash retrieval logic, and its signature has been streamlined. The getTransactionHash() method in both the provider and context has been updated to mark the batchId parameter as optional. Additionally, test files have been cleaned up by removing unnecessary timer-related code, and the type definition for SentBatch has been altered to remove the transactionHash property.

Changes

File(s) Change Summary
CHANGELOG.md, package.json Updated package version from 1.0.3 to 1.0.4; changelog now includes a new section noting the removal of the transactionHash parameter from send().
src/contexts/EtherspotTransactionKitContext.tsx Modified getTransactionHash method signature by changing the batchId parameter from required to optional.
src/providers/EtherspotTransactionKitContextProvider.tsx Removed receipt-fetching logic from the send() method and updated the getTransactionHash method signature (optional batchId) along with related comments.
__tests__/hooks/useEtherspotTransactions.test.js Removed unused Jest fake timers and associated comments, streamlining the test code.
src/types/EtherspotTransactionKit.ts Removed the transactionHash property from the SentBatch interface.

Sequence Diagram(s)

sequenceDiagram
    participant C as Client
    participant P as Provider
    C->>P: send(userOpHash)
    Note right of P: Receipt-retrieval logic removed
    P-->>C: Returns userOpHash (no transaction hash)
Loading
sequenceDiagram
    participant C as Client
    participant P as Provider
    C->>P: getTransactionHash(userOpHash, batchId?)
    P-->>C: Processes parameters & initiates retry logic
    alt Successful retrieval
        P-->>C: Returns transaction hash
    else Failure
        P-->>C: Returns error message
    end
Loading

Possibly related PRs

Suggested reviewers

  • IAmKio

Poem

I'm a hopping code rabbit, leaping with delight,
Cleaned-up methods and signatures, making our code just right.
No more transaction hashes in a tangled, dusty maze,
Version bump and streamlined flows now set our screen ablaze!
Happy coding in a world that's fluffy and bright! 🐇✨


📜 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 3a4482e and e6c24c8.

📒 Files selected for processing (6)
  • CHANGELOG.md (1 hunks)
  • __tests__/hooks/useEtherspotTransactions.test.js (17 hunks)
  • package.json (1 hunks)
  • src/contexts/EtherspotTransactionKitContext.tsx (1 hunks)
  • src/providers/EtherspotTransactionKitContextProvider.tsx (2 hunks)
  • src/types/EtherspotTransactionKit.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • src/types/EtherspotTransactionKit.ts
🔇 Additional comments (9)
package.json (1)

4-4: Version update looks good

Version has been incremented from 1.0.3 to 1.0.4, which correctly reflects the changes made in this PR.

CHANGELOG.md (1)

3-8: Changelog entry appropriately documents the changes

The changelog correctly reflects the removal of the transactionHash parameter from the send() method in EtherspotTransactionKitContextProvider, which aligns with the PR objective to revert and remove the transaction hash retrieval within the send function.

__tests__/hooks/useEtherspotTransactions.test.js (2)

282-282: Test cleanup looks good

The test file has been cleaned up by removing timer-related code. No functional changes to the tests themselves, just a cleanup of unnecessary comments and whitespace.


332-332: Additional test cleanups

Multiple instances of fake timer-related code have been removed throughout the test file. This is a good cleanup that doesn't affect the test functionality.

Also applies to: 402-402, 422-422, 480-480, 497-497, 565-565, 588-588, 658-658, 732-732, 870-870, 887-887, 967-967, 983-983, 1067-1067, 1081-1081

src/contexts/EtherspotTransactionKitContext.tsx (1)

19-19: Parameter correctly made optional

The batchId parameter in the getTransactionHash method signature has been made optional, which aligns with the PR objective of removing transaction hash retrieval from within the send function. This change provides more flexibility when calling this method.

src/providers/EtherspotTransactionKitContextProvider.tsx (4)

215-215: Simplified send operation to no longer retrieve transaction hash

The code now only includes the userOpHash in the object pushed to sentBatches, removing the transaction hash retrieval logic that was previously part of the send operation. This aligns with the PR objective of "removing getting transaction hash within send function."


246-248: Improved flexibility of getTransactionHash function

Making the batchId parameter optional enhances the function's flexibility. The updated comments for timeout and retryInterval parameters are now more clear about their default values and purpose.


254-254: Enhanced clarity in timeout and retry comments

The updated comments provide clearer guidance about the timeout duration calculation and explicitly reference the retryInterval parameter, improving code readability and maintainability.

Also applies to: 258-258


264-265: Improved error and warning messages

The revised error and warning messages are more informative and action-oriented, providing users with clear next steps when transaction hash retrieval fails. This improves the debugging experience.

Also applies to: 272-273

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Collaborator

@IAmKio IAmKio left a comment

Choose a reason for hiding this comment

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

LGTM

@RanaBug RanaBug merged commit 09261fa into master Mar 12, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Mar 18, 2025
3 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jul 10, 2025
3 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2025
3 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Aug 22, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants