Description
The castVote function in frontend/src/api.ts simulates the transaction against Soroban RPC but never signs or submits it. As a result, every vote action in the UI silently appears to succeed (no error is thrown) but no transaction is ever broadcast to the network — votes are never recorded on-chain.
Additionally, the function uses a dummy account sequence number instead of fetching the real sequence number from the network, which would cause submission to fail even if signing were added.
// Current (broken) behaviour in api.ts
const simResult = await server.simulateTransaction(tx);
return simResult; // ← returns simulation, never submits
The correct flow is:
- Build the transaction with the wallet's real public key and sequence number
- Simulate to get the footprint and fee
- Assemble the transaction with simulation results
- Send to the wallet for signing (Freighter / xBull)
- Submit the signed transaction via
server.sendTransaction
- Poll
server.getTransaction until the status is SUCCESS or FAILED
Acceptance Criteria
Related
Priority
Critical — votes cannot be cast. Core feature is completely broken.
Estimated Effort
Medium
Description
The
castVotefunction infrontend/src/api.tssimulates the transaction against Soroban RPC but never signs or submits it. As a result, every vote action in the UI silently appears to succeed (no error is thrown) but no transaction is ever broadcast to the network — votes are never recorded on-chain.Additionally, the function uses a dummy account sequence number instead of fetching the real sequence number from the network, which would cause submission to fail even if signing were added.
The correct flow is:
server.sendTransactionserver.getTransactionuntil the status isSUCCESSorFAILEDAcceptance Criteria
castVotefetches the real account sequence number from Soroban RPC before building the transactionWalletContextserver.sendTransactionserver.getTransactionuntil a terminal state (SUCCESSorFAILED) and returns the resultapi.ts(e.g.,createProposal) that share the same patternRelated
WalletContext.tsxsigning API being correctly exposed (see test: add property-based voting math tests for ties, abstains, quorum #393 forApp.tsximport issues)Priority
Critical — votes cannot be cast. Core feature is completely broken.
Estimated Effort
Medium