Skip to content

Make listing fields required and remove orphan executable contracts#1804

Merged
YoshihitoAso merged 3 commits intodev-26.6from
refactor/#1792
Apr 3, 2026
Merged

Make listing fields required and remove orphan executable contracts#1804
YoshihitoAso merged 3 commits intodev-26.6from
refactor/#1792

Conversation

@purplesmoke05
Copy link
Copy Markdown
Member

📌 Description

This pull request enforces non-null constraints on key columns in the listing table and audit columns (created, modified) across multiple tables, updates the SQLAlchemy models to reflect these constraints, and removes now-unnecessary runtime assertions.

✅ Related Issues

🔄 Changes

Database schema and migration changes:

  • Added a migration (4df7e2c1b8a3_v26_6_0_feature_1792.py) that backfills created and modified columns with the current timestamp where they are null, and alters these columns (as well as listing.token_address, listing.is_public, and listing.owner_address) to be non-nullable across all relevant tables. It also cleans up invalid data in listing and related tables.

  • Updated the Listing model to make token_address, is_public, and owner_address non-nullable, and removed the assertion that created is not None in its json method.

  • Updated the created and modified columns in Base, Company, and Notification models to be non-nullable.

API and codebase cleanup:

  • Removed runtime assertions checking for non-null values of token_address, is_public, owner_address, and created in several API endpoints, as these are now enforced at the schema level.

📌 Checklist

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Coverage

Coverage Report •
FileStmtsMissBranchBrPartCoverMissing
app/api/routers
   admin.py16230562481%93–95, 106, 152, 224–232, 234–236, 250, 253–254, 256, 281, 320, 389, 432–434, 437, 518–519
   company_info.py11818501684%193–194, 200, 286, 368, 376, 379, 385–387, 392–393, 398–399, 405, 410, 432, 450
   position.py4971201623875%486, 493, 540–541, 565–570, 628–629, 656–657, 691–696, 736–737, 764–765, 799–804, 1080–1081, 1108–1109, 1152–1157, 1228–1239, 1241–1242, 1252, 1290–1301, 1303–1304, 1314, 1350–1351, 1395–1404, 1406–1407, 1416, 1452, 1489, 1524, 1553, 1618–1619, 1621, 1623–1624, 1632, 1639, 1908, 1914–1919, 1931–1935, 1947–1951, 1962–1966, 1978–1979
app/model/blockchain
   token.py86431863496%99, 154, 158, 161, 164, 167, 416–417, 590–591, 615, 665–666, 673–674, 705–706, 906–907, 1046–1047, 1092–1093, 1222–1223, 1337–1338, 1377–1378, 1662–1663
app/model/db
   base.py2842185%48, 51, 66–67
   company.py2332186%52, 79, 82
   listing.py2522192%52, 61
   notification.py6946394%42, 53, 130, 139
tests/app
   company_info_ListAllCompanies_test.py401060100% 
   eth_SendRawTransactionNowait_test.py281000100% 
   eth_SendRawTransaction_test.py451000100% 
   eth_WaitForTransactionReceipt_test.py89000100% 
   position_PositionCouponContractAddress_test.py375000100% 
   position_PositionCoupon_test.py40728299%188, 195
   position_PositionMembershipContractAddress_test.py167000100% 
   position_PositionMembership_test.py28428299%146, 153
   position_PositionShareContractAddress_test.py637210299%202, 211
   position_PositionShare_Lock_Event_GET_test.py3680380100% 
   position_PositionShare_test.py360210299%208, 217
   position_PositionStraightBondContractAddress_test.py420310399%198, 205, 207
   position_PositionStraightBond_Lock_Event_GET_test.py3760380100% 
   position_PositionStraightBond_test.py337310399%200, 207, 209
   position_Position_test.py432220299%72, 81
   token_TokenHolders_Search_test.py348040100% 
   token_TokenHolders_test.py331020100% 
   token_bond_StraightBondTokenAddresses_test.py340060100% 
   token_bond_StraightBondTokenDetails_test.py116000100% 
   token_bond_StraightBondTokens_test.py3860100100% 
   token_coupon_CouponTokenAddresses_test.py327060100% 
   token_coupon_CouponTokenDetails_test.py107000100% 
   token_coupon_CouponTokens_test.py3720100100% 
   token_membership_MembershipTokenAddresses_test.py327060100% 
   token_membership_MembershipTokenDetails_test.py108000100% 
   token_membership_MembershipTokens_test.py3730100100% 
   token_share_ShareTokenAddresses_test.py335060100% 
   token_share_ShareTokenDetails_test.py111000100% 
   token_share_ShareTokens_test.py3820100100% 
   token_transfer_history_ListAllTransferHistory_test.py264020100% 
   token_transfer_history_ListTokenTransferApprovalHistory_test.py4480280100% 
   token_transfer_history_ListTokenTransferHistory_test.py545020100% 
   token_transfer_history_SearchTokenTransferApprovalHistory_test.py8540180100% 
   token_transfer_history_SearchTokenTransferHistory_test.py742020100% 
TOTAL378811724370077095% 

Tests Skipped Failures Errors Time
1268 0 💤 0 ❌ 0 🔥 10m 13s ⏱️

@purplesmoke05 purplesmoke05 marked this pull request as ready for review April 3, 2026 04:44
@YoshihitoAso YoshihitoAso merged commit c9b8a56 into dev-26.6 Apr 3, 2026
12 checks passed
@YoshihitoAso YoshihitoAso deleted the refactor/#1792 branch April 3, 2026 09:06
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.

[REFACTOR] Make listing records non-nullable across admin and issuer token flows

2 participants