BoostryJP / ibet-Prime

Advanced API Toolkit for Digital Securities Issuance and Management on the ibet Network 🚀
https://ibet.jp/ibet-for-fin
Apache License 2.0
11 stars 1 forks source link

Refine transfer data schema to classify transfer data derived from Unlock events #713

Closed purplesmoke05 closed 1 day ago

purplesmoke05 commented 2 days ago

Close #700

DB

API

class TransferBase(BaseModel):
    transaction_hash: str
    token_address: str
    from_address: str
    from_address_personal_information: Optional[PersonalInfo] = Field(...)
    to_address: str
    to_address_personal_information: Optional[PersonalInfo] = Field(...)
    amount: int
    block_timestamp: str

class Transfer(TransferBase):
    source_event: Literal[TransferSourceEventType.Transfer] = Field(
        description="Source Event"
    )
    data: None = Field(description="Event data")

class UnlockData(BaseModel):
    message: Literal[
        "garnishment",
        "inheritance",
        "force_unlock",
    ]

class UnlockTransfer(TransferBase):
    source_event: Literal[TransferSourceEventType.Unlock] = Field(
        description="Source Event"
    )
    data: UnlockData | dict = Field(description="Event data")

Batch

github-actions[bot] commented 2 days ago

Coverage

Coverage Report •
FileStmtsMissCoverMissing
app/model/db
   __init__.py320100% 
   idxtransfer.py280100% 
app/model/schema
   __init_\.py200100% 
   transfer.py1320100% 
app/routers/issuer
   bond.py11331199%717, 1129, 2124, 2336, 2500, 2791, 2799, 3740–3743
   position.py182199%353
   settlement_issuer.py1561093%170, 298, 300, 436, 438, 446, 454, 462, 573–574
   share.py11191199%684, 1096, 2052, 2264, 2428, 2728, 2736, 3676–3679
app/routers/misc
   settlement_agent.py165298%221, 323
batch
   indexer_transfer.py1512086%79–80, 85–87, 212, 225–226, 254, 271–272, 294–296, 325–326, 332–335
tests/app
   test_bond_transfers_ListBondTokenTransferHistory.py8930100% 
   test_positions_ForceUnlock.py2730100% 
   test_share_transfers_ListShareTokenTransferHistory.py8930100% 
tests/app/model/blockchain
   test_token_IbetShare.py15720100% 
   test_token_IbetStraightBond.py15970100% 
tests/batch
   test_indexer_transfer.py6440100% 
TOTAL76268124898% 

Tests Skipped Failures Errors Time
1953 0 :zzz: 0 :x: 0 :fire: 24m 6s :stopwatch: