Skip to content

tests(pool): no test for funding the same invoice twice #444

Description

@K1NGD4VID

Summary

The pool's fund_invoice checks both the invoice status and its own FundedInvoice key. There is no test verifying double-funding is prevented through both checks.

Current Behavior

fund_invoice at contracts/pool/src/lib.rs:351-467 checks invoice status and FundedInvoice key. If someone tries to fund an already-funded invoice, the pool's own check catches it. But there is no test for this scenario.

Expected Behavior

Add tests for calling fund_invoice twice with the same invoice, and for calling fund_invoice after repayment/default.

Acceptance Criteria

  • Test: double fund_invoice panics with AlreadyFunded
  • Test: fund_invoice after repayment (should fail)
  • Test: fund_invoice after default (should fail)

Tech Stack

contracts/pool/src/test.rs

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions