Skip to content

feat(storage): exhaustive DataKey, typed accessors, TTL helpers, clai… - #115

Merged
jhayniffy merged 2 commits into
InsurNiffy:mainfrom
deborahamoni0-prog:feat/storage-layout-datakey
Mar 25, 2026
Merged

feat(storage): exhaustive DataKey, typed accessors, TTL helpers, clai…#115
jhayniffy merged 2 commits into
InsurNiffy:mainfrom
deborahamoni0-prog:feat/storage-layout-datakey

Conversation

@deborahamoni0-prog

Copy link
Copy Markdown
Contributor

…m+vote impl

  • storage.rs: full DataKey enum covering Admin, Token, Paused, ClaimCounter, Voters (instance) and PolicyCounter, Policy, Claim, Vote (persistent); typed read/write helpers are the only path to env.storage(); TTL bump on every persistent write (~1 yr / 6M ledgers); ASCII keyspace diagram for auditors and indexer team
  • claim.rs: file_claim + vote_on_claim implemented exclusively through storage helpers; #[contractevent] for ClaimFiled, VoteLogged, ClaimProcessed; majority-vote tally with immediate payout on approve
  • lib.rs: expose file_claim, vote_on_claim, is_paused, get_voters entrypoints; storage module made pub for test-only as_contract seeding
  • tests/storage.rs: 16 integration tests covering all keyspace tiers, full approve/reject vote flows, duplicate-vote guard, non-voter guard, and counter immutability on pure-read paths; all seeding via storage helpers only — no raw DataKey construction in domain modules

Closes #3

…m+vote impl

- storage.rs: full DataKey enum covering Admin, Token, Paused,
  ClaimCounter, Voters (instance) and PolicyCounter, Policy, Claim,
  Vote (persistent); typed read/write helpers are the only path to
  env.storage(); TTL bump on every persistent write (~1 yr / 6M ledgers);
  ASCII keyspace diagram for auditors and indexer team
- claim.rs: file_claim + vote_on_claim implemented exclusively through
  storage helpers; #[contractevent] for ClaimFiled, VoteLogged,
  ClaimProcessed; majority-vote tally with immediate payout on approve
- lib.rs: expose file_claim, vote_on_claim, is_paused, get_voters
  entrypoints; storage module made pub for test-only as_contract seeding
- tests/storage.rs: 16 integration tests covering all keyspace tiers,
  full approve/reject vote flows, duplicate-vote guard, non-voter guard,
  and counter immutability on pure-read paths; all seeding via storage
  helpers only — no raw DataKey construction in domain modules

Closes InsurNiffy#3
@drips-wave

drips-wave Bot commented Mar 24, 2026

Copy link
Copy Markdown

@deborahamoni0-prog Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@jhayniffy
jhayniffy merged commit bd635d5 into InsurNiffy:main Mar 25, 2026
0 of 3 checks passed
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.

Contract — Storage layout: DataKey design, maps, and typed accessors

2 participants