Skip to content

fix: address issues #1142, #1143, #1145 - #1236

Merged
Emeka000 merged 1 commit into
Emeka000:mainfrom
BethelDev-io:fix/issues-1142-1143-1145
Jul 28, 2026
Merged

fix: address issues #1142, #1143, #1145#1236
Emeka000 merged 1 commit into
Emeka000:mainfrom
BethelDev-io:fix/issues-1142-1143-1145

Conversation

@BethelDev-io

Copy link
Copy Markdown
Contributor

closes #1142
closes #1143
closes #1145

#1142 - Paginate BankIndex, DonorIndex, BloodTypeIndex, StatusIndex

  • Add BankIndexMeta/Page, DonorIndexMeta/Page, BloodTypeIndexMeta/Page, StatusIndexMeta/Page DataKey variants to types.rs
  • Replace unbounded Vec indexes in storage.rs with fixed-size pages (INDEX_PAGE_SIZE=20) following the same pattern as StatusHistory
  • Update remove_from_status_index to scan paginated pages

#1143 - Reject duplicate unit_ids in reserve_blood

  • Add seen_units Map<u64,bool> dedup check before validation loop in inventory/src/lib.rs::reserve_blood, returns DuplicateBloodUnit on repeat

#1145 - Extend TTL on escrow confirmation flags

  • Add extend_ttl(PERSISTENT_BUMP_THRESHOLD, PERSISTENT_BUMP_TO) after setting coord_ok in release_escrow and hosp_ok in confirm_receipt, matching the pattern used everywhere else in payments/src/lib.rs

Emeka000#1142 - Paginate BankIndex, DonorIndex, BloodTypeIndex, StatusIndex
  - Add BankIndexMeta/Page, DonorIndexMeta/Page, BloodTypeIndexMeta/Page,
    StatusIndexMeta/Page DataKey variants to types.rs
  - Replace unbounded Vec<u64> indexes in storage.rs with fixed-size pages
    (INDEX_PAGE_SIZE=20) following the same pattern as StatusHistory
  - Update remove_from_status_index to scan paginated pages

Emeka000#1143 - Reject duplicate unit_ids in reserve_blood
  - Add seen_units Map<u64,bool> dedup check before validation loop in
    inventory/src/lib.rs::reserve_blood, returns DuplicateBloodUnit on repeat

Emeka000#1145 - Extend TTL on escrow confirmation flags
  - Add extend_ttl(PERSISTENT_BUMP_THRESHOLD, PERSISTENT_BUMP_TO) after
    setting coord_ok in release_escrow and hosp_ok in confirm_receipt,
    matching the pattern used everywhere else in payments/src/lib.rs
@Emeka000
Emeka000 merged commit 7cbcc67 into Emeka000:main Jul 28, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants