Public: anyone can read this; the crew can change it.
A test pins the storage cap's words and figures: no limit asks nothing, a stale figure is re-measured, and the refusal names the figure #6911
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
src/core/storage.ts sets how much an account may store.
storageLimitBytes,storageStale,storageChanged,storageLimitMessageandstorageSentenceare not named in a test. test/quotas-storage.test.ts reaches the cap only through the routes.Done:
storageLimitBytesgives undefined when no limit is set and the bytes when one is, and it reads a setting change on the next call.storageStale(app, owner), the next measurement walks the repository again; until then the cached figure is used.storageLimitMessagenames the account's figure and the limit in human sizes, never raw bytes, and never another account's figure.storageSentencereads right at 0, just under and just over the limit.This is a new test file only. Change code only where the test finds a hole, and say so in the pull. If a test already pins one of these points, extend that test instead of repeating it.
Files: test/storage-cap.test.ts
Before pushing:
bun x tsc --noEmitand the test you add. Tests passnowin and never read the wall clock.