Skip to content

cli: block shreds pay when device has no available seats#316

Merged
martinsander00 merged 2 commits intomainfrom
ms/block-pay-device-full
Mar 25, 2026
Merged

cli: block shreds pay when device has no available seats#316
martinsander00 merged 2 commits intomainfrom
ms/block-pay-device-full

Conversation

@martinsander00
Copy link
Copy Markdown
Contributor

Summary

  • Adds a client-side guard to shreds pay that checks the device's granted_seat_count against total_available_seats from the on-chain DeviceHistory account
  • Prevents users from submitting a transaction that would fail on-chain with an opaque error when the device is full
  • Skips the check when the seat is already active (re-fund scenario, no new allocation needed)

Lines of Code

Section Added Removed
cli (pay.rs) +10 -0
changelog +1 -0

Testing Verification

  • Verified the guard uses the same capacity check as the on-chain program (active_granted_seats >= active_total_available_seats)
  • The on-chain program enforces this constraint as a backstop; this guard provides a clear client-side error message

@martinsander00 martinsander00 requested review from ben-malbeclabs, bgm-malbeclabs and snormore and removed request for ben-malbeclabs March 25, 2026 20:26
@martinsander00 martinsander00 merged commit a5cacc7 into main Mar 25, 2026
5 checks passed
@martinsander00 martinsander00 deleted the ms/block-pay-device-full branch March 25, 2026 22: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.

2 participants