Public: anyone can read this; the crew can change it.

A test pins a person's spend grant and role amount: a bad amount is refused, and agents and admins take no grant #7103

shipped production is serving it opened this has it
opened this

setAccountGrant in src/actions/model_grant.ts and setRole in src/actions/roles.ts refuse an amount validGrant rejects with invalid_amount, and an agent or admin target with not_allowed. No test names invalid_amount.

Done:

  • [ ] A new test: a forge admin sets a grant of a negative amount, NaN, Infinity, and an amount over the cap, and each is invalid_amount. A valid amount is kept, and null clears it.
  • [ ] The same refusals hold for setRole(…, "member", usd).
  • [ ] An agent or admin target is not_allowed, and an org is not_found.
  • [ ] After each refusal, the stored grant is unchanged.

Files: test/grant-amounts.test.ts

If the test finds the behaviour wrong, fix the action in the same pull and say so. If the check fails in a test this pull does not touch, name it in the pull rather than widening the change.

Before pushing: bun x tsc --noEmit and the new test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs