Skip to content

Add reallocation functionality to transfer process - #1659

Merged
YoshihitoAso merged 3 commits into
dev-25.9from
feature/#1657
Jul 23, 2025
Merged

Add reallocation functionality to transfer process#1659
YoshihitoAso merged 3 commits into
dev-25.9from
feature/#1657

Conversation

@purplesmoke05

Copy link
Copy Markdown
Member

📌 Description

This pull request introduces a new "Reallocation" transfer event type to the system, updates related models and schemas, and adds functionality to detect and handle this event during batch processing. It also includes tests to validate the new functionality.

✅ Related Issues

🔄 Changes

Enhancements to Transfer Event Types

  • Added a new REALLOCATION event type to the IDXTransferSourceEventType and TransferSourceEvent enums in app/model/db/idx_transfer.py and app/model/schema/token.py. [1] [2]
  • Updated the TransferHistory and TransferHistoriesResponse models to include the new REALLOCATION event type. [1] [2]

Batch Processing Updates

  • Modified batch/indexer_Transfer.py to detect "Reallocation" events by checking transaction data for a specific marker (c0ffee00) and added logic to process these events accordingly.
  • Added HexBytes import to support transaction data handling.

Testing Enhancements

  • Added a new helper function reallocate_share_token in tests/contract_modules.py to simulate "Reallocation" events.
  • Updated tests/batch/indexer_Transfer_test.py to include tests for "Reallocation" events, ensuring proper detection, processing, and database insertion. [1] [2] [3] [4] [5] [6] [7]

📌 Checklist

  • I have added tests where necessary.
  • I have updated the documentation where necessary.

@github-actions

github-actions Bot commented Jul 23, 2025

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
app/model/db
   idx_transfer.py46197%98
app/model/schema
   token.py2100100% 
batch
   indexer_Transfer.py3115083%98, 118, 194–196, 252–256, 294, 369, 393–394, 459, 476–477, 527, 544–545, 595, 612–613, 631–632, 635–643, 646–657, 661–664
tests
   contract_modules.py4012693%209–211, 218–220, 377–379, 452–453, 660, 662–663, 772–774, 848–850, 980–981, 984, 1068–1069, 1072
tests/batch
   indexer_Transfer_test.py5950100% 
TOTAL44323157596% 

Tests Skipped Failures Errors Time
1485 0 💤 0 ❌ 0 🔥 12m 56s ⏱️

@purplesmoke05

Copy link
Copy Markdown
Member Author

Additionally fixed the API docs schema: a0bda94

@YoshihitoAso
YoshihitoAso merged commit 1309456 into dev-25.9 Jul 23, 2025
11 checks passed
@YoshihitoAso
YoshihitoAso deleted the feature/#1657 branch July 23, 2025 08:30
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.

[FEATURE] Support annotation-based reallocation transfers

2 participants