Skip to content

Add negative/invalid-input test cases for MultiSigEscrowClient.initMultiSigOperation #141

Description

@meshackyaro

Description

MultiSigEscrowClient._validateInitParams (src/escrow/multisig.ts) implements seven distinct validation rules for initMultiSigOperation — missing escrowId, empty signers, threshold < 1, threshold > signers.length, missing unsignedXdr, missing networkPassphrase, a networkPassphrase mismatch against this.config.networkPassphrase, and duplicate signer addresses — each returning a distinct { ok: false, error } message. tests/multisig.test.ts exists, but it's worth confirming (and, per this audit, several of these specific negative branches — particularly the networkPassphrase mismatch and the duplicate-signers check — don't appear to have a dedicated assertion) that every one of these seven validation branches has its own explicit test case, since a regression in any single one would silently let an invalid multi-sig operation through.

Component

SDK

Difficulty

🟡 Medium

Tasks

  • Cross-check tests/multisig.test.ts against all seven branches in _validateInitParams and add any missing negative test cases (especially the networkPassphrase mismatch and duplicate-signers checks)
  • Add a test for threshold === signers.length (the boundary, valid case) and threshold > signers.length (invalid) to confirm the boundary is handled correctly
  • Add a test confirming addSignature correctly rejects a signer not in params.signers with the exact "not an authorised signer" message

Acceptance Criteria

  • Every branch in _validateInitParams has a corresponding explicit negative test case

Estimated Time

1-2 days

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions