Skip to content

feat: add MWK institutions and provision buckets migration #479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

sundayonah
Copy link
Collaborator

Description

This PR adds support for Malawi Kwacha (MWK) institutions to the aggregator system. The implementation includes 9 financial institutions (8 banks and 1 mobile money providers) along with corresponding provision buckets for the MWK currency.

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

chibie and others added 16 commits May 28, 2025 07:20
- Added engine configuration fields to .env.example and Configuration struct.
- Updated CreateSmartAddress function to return only the address, removing salt.
- Refactored linked address creation and mutation to make salt optional.
- Introduced sender field in LockPaymentOrder schema and related mutations.
- Improved error handling and response parsing in various services.

Co-authored-by: Prosper <[email protected]>
…ntroller

- Introduced order service integration to handle transfer events asynchronously.
- Enhanced error logging for transfer processing failures.
- Updated tests to reflect changes in order service interactions and removed unused code.
…actor service interactions

- Added ThirdwebSecretKey to EngineConfiguration and updated EngineConfig function to retrieve it.
- Removed ThirdwebSecretKey from OrderConfiguration and related functions.
- Refactored order processing methods in ProviderController to eliminate unnecessary nil parameters.
- Simplified context handling in payment order initiation.
- Integrated engine service into ReceiveAddressService and OrderEVM for improved transaction handling.
- Streamlined event indexing and transaction status checks across various services.

Co-authored-by: Prosper <[email protected]>
- Implemented a retry mechanism in GetContractEvents to handle timeouts and ensure successful retrieval of contract events.
- Updated WaitForTransactionMined to include error handling for transaction failures.
- Removed unused indexer test and indexer service files to streamline the codebase.
- Added new migration for engine bump to support upcoming features.

Co-authored-by: Prosper <[email protected]>
- Remove WaitGroups to allow concurrent processing of blockchain events
- Implement chunked block processing (1000 blocks per chunk)
- Add Tron network support with GetTronLatestBlock function
- Adjust task scheduling intervals:
  - Blockchain event indexing: every 2 seconds
  - Stale user operations: every 2 minutes
- Remove unused ReassignPendingOrders functionality
- Clean up commented code and improve error handling

This change improves the efficiency of blockchain event processing by:
- Enabling true parallel processing of events across networks
- Preventing task blocking through chunked processing
- Supporting both EVM and Tron networks
- Optimizing resource usage by removing unnecessary synchronization
- Extract common indexer logic into runIndexers function
- Implement chunked processing for EVM networks only
- Keep single-range processing for Tron networks
- Remove duplicate code and improve maintainability

This change improves the code by:
- Separating network-specific block processing logic
- Reducing code duplication
- Making the indexing process more efficient
- Maintaining different processing strategies for EVM and Tron
- Add GetTronLatestBlock function to fetch latest block from Tron network
- Integrate Tron indexer for event processing
- Adjust block processing duration for Tron (60s) vs EVM (10s)
- Remove unused ReassignPendingOrders functionality
- Update task scheduling intervals:
  - Blockchain event indexing: every 2 seconds
  - Stale user operations: every 2 minutes

This change enables:
- Support for Tron network event indexing
- Different processing strategies for Tron and EVM networks
- More efficient task scheduling
- Move event processing logic to common package:
  • ProcessTransfers
  • ProcessCreatedOrders
  • ProcessSettledOrders
  • ProcessRefundedOrders
- Remove duplicate code from EVM and Tron indexers
- Add block time to test fixtures
- Update test assertions for Engine integration

This change:
- Reduces code duplication
- Improves maintainability
- Makes event processing consistent across networks
- Prepares test fixtures for Engine integration
…sing

- Introduced INDEXING_DURATION to .env.example and OrderConfiguration struct.
- Updated TaskIndexBlockchainEvents to utilize configurable indexing duration.
- Ensured minimum duration for Tron network processing.
feat: Integrate Engine for Account Abstraction and Contract Management
- Modified the networks table to add a default value for the block_time column.
- Updated the atlas checksum for the new migration file.
@sundayonah sundayonah requested review from chibie and 5ran6 as code owners June 12, 2025 04:40
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