docs(storage): document the model and invariants - #428
Merged
mikewheeleer merged 2 commits intoJul 28, 2026
Conversation
env.events().all() reflects only the most recent contract invocation, not a running total across separate calls (consistent with every other event test in this file). The test compared post-transfer event count against a pre-transfer count captured after a *different* call (set_service_metadata), expecting accumulation that never happens, so it failed on every run regardless of contract behavior. Fixed to assert directly on this call's own event count.
Jagadeeshftw
force-pushed
the
docs/storage-01-model
branch
from
July 28, 2026 21:18
877f9d6 to
3a20d4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/escrow/storage.mddescribes itself as "the authoritative map of everyDataKeyvariant" but seven variants were missing, and one existing note was inaccurate. This closes those gaps:UsageAlertThreshold,MinServicePrice,MaxServicePrice,PriceTiers,AgentCredit,AgentServiceIndex,AgentServices, andDisputekeys in the reference tables, plus a prose "details" section for each.settlenever checks theDisputeflag — an open dispute does not actually block settlement, contradicting the source doc-comment onopen_disputewhich claimed "settleis blocked". Corrected the misleading comment inlib.rs(comment-only, no behavior change) and called this out explicitly in the new Security notes bullets.AgentServices(Address)is declared but never read or written anywhere inlib.rs, despite a comment describing it as the keysettle_alluses —settle_allactually readsAgentServiceIndex. Documented as unused/dead storage.UsageAlertThresholdhas no setter, so theusage_hialert path inrecord_usagecan never fire on the current contract.No contract behavior changes — this is a docs-and-comment-only PR (the one
lib.rschange corrects a comment to match actualsettlebehavior).Closes #286
Validation
cargo fmt --all -- --checkcargo build -p escrowcargo test -p escrow— 352 passed, 1 pre-existing failure unrelated to this change (test_transfer_service_ownership_genuine_transfer_emits_event, fails identically onmain)