Skip to content

feat(dapp): let a funder cancel and a receiver decline an unaccepted grant - #197

Merged
lmcorbalan merged 9 commits into
feat/157-token-forge-migrationfrom
feat/181-end-pending-grant
Sep 9, 2026
Merged

feat(dapp): let a funder cancel and a receiver decline an unaccepted grant#197
lmcorbalan merged 9 commits into
feat/157-token-forge-migrationfrom
feat/181-end-pending-grant

Conversation

@lmcorbalan

@lmcorbalan lmcorbalan commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #181

An unaccepted grant could not be ended from either side, so the holding it reserved stayed out of the funder's balance for good. Both parties now have a way out.

Changes

  • A funder cancels an outstanding grant and a receiver declines one, both from Pending
  • Ending a grant returns the holding it reserved to the funder's spendable balance
  • Ending a grant forgets the disclosure blob it left in this browser and the read-miss count keyed to the same holding
  • Accepting a grant now forgets that read-miss count too
  • Each pending-grant button carries the grant's title as its accessible name
  • A browser that refuses to write no longer fails an exit the ledger has already accepted

Deviations

  • Both actions live on Pending, not the dashboard the issue names: the dashboard renders no pending grants
  • Accept now prunes the read-miss count too, the same leak's other half, which the issue did not name
  • The pre-existing Accept button gained an accessible name beside the two new ones, or a list reads "Decline, Accept, Decline, Accept"
  • Criterion 3 is proven against the exclusion rule, not the write: the test harness models only the factory choice
  • The frontend README stopped saying the funder can "withdraw" a pending grant: that word names the receiver's claim, and the control has always been labelled Cancel

Acceptance criteria

  • A funder can cancel a grant the receiver has not accepted
  • A receiver can decline a grant offered to them
  • Both actions free the holdings the grant named from the funder's reserved balance
  • Ending a grant drops the disclosure blobs it left behind
  • Neither party is offered the other's action

Test plan

Automated tests

  1. Run pnpm install
  2. Run pnpm -C dapp/frontend test
  3. Expect 13 files and 222 tests passing
  4. Run pnpm lint, pnpm typecheck, pnpm build, pnpm test, pnpm knip, pnpm docs:check and pnpm run check:anatomy
  5. Expect all seven green

Manual verification

  1. Run ./scripts/dev-stack.sh up and connect a funder wallet on http://localhost:3012
  2. Create a grant to a second party and note the balance
  3. Open Pending as the funder, click Cancel, confirm in the dialog
  4. Expect a "Grant cancelled" toast, the card gone, and the balance back up by the granted amount
  5. Create another grant, connect the receiver's wallet and open Pending
  6. Click Decline, confirm, and expect a "Grant declined" toast and the card gone
  7. Switch back to the funder and expect the balance restored again
  8. In localStorage, expect neither vesting.tokenDisclosures nor vesting.tokenReadMisses to still name the ended grants' holdings

Breaking changes

None.

Checklist

  • Self-reviewed my own diff
  • Tests added or updated
  • Docs updated (if applicable)
  • No unrelated changes bundled in

Screenshots

To be added before review.

@lmcorbalan lmcorbalan self-assigned this Sep 9, 2026
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
demo.canton-dappbooster Ready Ready Preview Sep 9, 2026 4:35pm UTC
docs.canton-dappbooster Ready Ready Preview Sep 9, 2026 4:35pm UTC

Request Review

@lmcorbalan
lmcorbalan merged commit eaa6b0a into feat/157-token-forge-migration Sep 9, 2026
8 checks passed
@lmcorbalan
lmcorbalan deleted the feat/181-end-pending-grant branch September 9, 2026 16:46
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Canton - dAppBooster (#390) Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants