Skip to content

BatchWallet: convert duplicate-within-batch panic into per-item Failure #129

Description

@snowrugar-beep
  • Problem Statement. contracts/batch-wallet/src/lib.rs
    batch_create_wallets panics (DuplicateWallet = 7) when the
    same WalletCreateRequest appears twice in one batch. A
    partial-success outcome is more composable.
  • Why it matters. Atomic-or-nothing is restrictive against
    rescue/restoration flows that prefer best-effort semantics.
  • Expected Outcome. When duplicates appear in a batch, return
    them as WalletCreateResult::Failure(owner, code) while processing
    the others. Tests prove partial-success behavior.
  • Acceptance Criteria.
    1. New test: send N+1 requests, M duplicates → result reports
      failed=M, others succeed, event wallet_duplicate emitted per
      duplicate.
    2. Document the new contract in README.
  • Files / Modules. contracts/batch-wallet/src/lib.rs.
  • Difficulty. Medium.
  • Effort. 1 day.
  • Labels. contracts, batch-wallet, needs-spec.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26batch-walletImported from docs/ISSUES_100.md (label "batch-wallet").contractsImported from docs/ISSUES_100.md (label "contracts").needs-specRequires a written design/acceptance spec before implementation.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions