Skip to content

[BUG] TrustFlowClient.connect() doesn't reject if the configured contractId doesn't exist on the target network, resolving as if everything is fine #805

Open

Description

@meshackyaro

Description

connect() is documented as establishing readiness to interact with the configured contract, but it currently only checks RPC connectivity, not that the contract ID actually resolves to a deployed contract on the target network.

Component

core

Steps to Reproduce

  1. Configure TrustFlowClient with a syntactically-valid but nonexistent/wrong-network contractId.
  2. Call .connect().
  3. Observe it resolving successfully.

Expected Behavior

.connect() should verify the contract exists on the configured network (e.g. via a lightweight simulation call) and reject clearly if not.

Actual Behavior

.connect() resolves successfully with a fundamentally broken configuration, and the real error only surfaces later, disconnected from its actual cause.

Environment

  • SDK version: 0.3.x
  • Node version: 20.x, 22.x
  • OS: macOS / Linux
  • Network: TESTNET

Code Example

await client.connect(); // resolves fine
await client.getEscrow('1'); // fails here instead, confusingly

Error Output

N/A — no thrown error; behavior is incorrect but silent.

Difficulty

🟡 Medium

Additional Context

connect()'s current implementation only pings the RPC endpoint's health, not the configured contract's existence.

Activity

  1. added
    bug
    priority: high
    difficulty: medium
    on Oct 29, 2026
  2. guptakumarranjeet150 commented on Oct 29, 2026

    @guptakumarranjeet150

    Hi team,

    I analyzed "[BUG] TrustFlowClient.connect() doesn't reject if the configured contractId doesn't exist on the target network, resolving as if everything is fine" in trustflow-protocol/trustflow-sdk and have a concrete technical roadmap to resolve it.

    I have reviewed the problem description and acceptance criteria for this issue. I have a clear, tested implementation ready with defensive error handling and 100% green CI proof.

    I will deliver a clean, well-tested, and production-ready PR promptly upon assignment. Kindly assign this issue to me.

    Thank you!

  3. maxx-GENIUS commented on Nov 6, 2026

    @maxx-GENIUS
    Contributor

    Hey team,

    I reviewed the issue for TrustFlowClient.connect() doesn't reject if the configured contractId doesn't exist on the target network, resolving as if everything is fine. We need to resolve 'trustflowclient.connect() doesn't reject if the configured contractid doesn't exist on the target network, resolving as if everything is fine' cleanly across the target modules.

    Proposed Implementation:

    1. Trace the current code execution path in TrustFlowClient.connect() to isolate the behavior boundary.
    2. Implement a focused, modular fix for 'TrustFlowClient.connect() doesn't reject if the configured contractId doesn't exist on the target network, resolving as if everything is fine' adhering strictly to repository architecture.
    3. Ensure defensive guards and backward compatibility are maintained.

    Testing & Verification:
    I will reproduce the target scenario locally, add regression unit tests, and confirm all CI checks pass 100% green.

    Please assign this to me and I will deliver a clean PR with passing tests shortly.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcoredifficulty: mediumpriority: highsdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions