Skip to content

bug: batchTransaction confirmation logic races simulation branches #431

Description

@nanaf6203-bit

Summary

src/lib/batchTransaction.ts fabricates confirmation data with Math.random and races between real and fake states, leading to false positives in demos.

Affected area

src/lib/batchTransaction.ts

Steps to reproduce / impact

Inconsistent success/failure branching on confirmation lookup; the transaction can appear confirmed in the UI while the underlying promise hasn't resolved, or vice versa.

Expected behaviour

Use a single awaiting function (e.g. waitForTransaction from viem/ethers) and avoid hand-rolled simulation in production code paths. Move the demo data behind a feature flag.

Acceptance criteria

  • Replace simulated confirmation logic with real provider reads.
  • Add tests verifying success/failure propagation.
  • Add a feature flag NEXT_PUBLIC_DEMO_TX enabling the simulated branch only in dev.

Activity

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

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working correctlypriority/p2P2 — medium priority

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions