Skip to content

[Bug] Target pool deadline uses ledger sequence but frontend likely passes Unix timestamp #13

Description

@grantfox-oss

Getting Started

  1. Fork the repository: https://github.com/JointSave-org/Joint_Save
  2. Clone your fork:
   git clone https://github.com/<your-username>/Joint_Save.git
   cd Joint_Save
  1. Create a new branch:
   git checkout -b fix/target-pool-deadline-ledger-sequence

Overview

TargetPool::initialize validates deadline as a ledger sequence number (u32), but the frontend form likely collects a date value (Unix timestamp). This mismatch sets deadlines incorrectly.

Steps to Reproduce

  1. Create a Target Pool with a 30-day deadline using the date picker
  2. Inspect the transaction on Stellar Expert
  3. Compare deadline param to current ledger sequence

Required Fix

Frontend (target-form.tsx + useJointSaveContracts.ts)

  • Replace date picker with a duration input (days/weeks/months)
  • Add helper:
  function daysToLedgers(days: number): number {
    return Math.floor(days * 24 * 60 * 60 / 6); // ~6s per ledger
  }
  • Fetch current ledger sequence from RPC, add offset before submitting

Display

  • Show "Deadline: ~30 days (ledger ~XXXXXXX)" in form
  • group-details.tsx: convert stored ledger sequence to estimated date

Acceptance Criteria

  • Deadline param passed is a valid future ledger sequence
  • Form shows human-readable duration, not a raw ledger field
  • Group detail shows estimated deadline date
  • refund remains callable after deadline passes

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workinggood first issueGood for newcomerslow-complexitySimple isolated change

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions