Skip to content

Refactor the tx data processing method #538

@nullpointer0x00

Description

@nullpointer0x00

Summary

Refactor the transaction data processing method (processAndSaveTransactionData) to use a common interface for chaining processing steps and handling errors consistently.

Problem Definition

Currently, the processAndSaveTransactionData method sequentially calls various save methods, with error handling implemented only for the IBC channel data. This approach is not scalable or maintainable as it requires individual try-catch blocks for each processing step, leading to code duplication and potential oversight. By introducing a common interface for handling these steps, the Provenance Network Explorer can achieve more robust and consistent error management across all transaction processing steps. This change does not require support from the Provenance Blockchain or Cosmos SDK.

Proposal

  • Define a common interface that encapsulates the processing of transaction data and error handling.
  • Implement this interface for each of the save methods currently used in processAndSaveTransactionData (e.g., saveMessages, saveTxFees, saveIbcChannelData, etc.).
  • Refactor the processAndSaveTransactionData method to utilize this interface, allowing all processing steps to be chained together and handled consistently.
  • Ensure that the new approach provides clear logging and error tracking

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions