Skip to content

fix: issue #256 - savings goals storage and target date validation#393

Open
menawar wants to merge 1 commit intoRemitwise-Org:mainfrom
menawar:fix/issue-256-savings-goals
Open

fix: issue #256 - savings goals storage and target date validation#393
menawar wants to merge 1 commit intoRemitwise-Org:mainfrom
menawar:fix/issue-256-savings-goals

Conversation

@menawar
Copy link
Copy Markdown
Contributor

@menawar menawar commented Mar 25, 2026

This PR resolves failing tests and implements strict target date validation for the savings_goals contract. close #256

Key Changes

  • Storage Migration: Moved all core contract state (GOALS, NEXT_ID, OWNER_GOAL_IDS, etc.) from instance() to persistent() storage for better data reliability.
  • Target Date Validation: Implemented strict checks in create_goal to ensure target dates are in the future and within a 10-year window.
  • TTL Management: Added robust TTL management for all persistent keys, ensuring they are bumped appropriately during state changes.
  • Initialization Correction: Fixed init() to start NEXT_ID at 0, ensuring consistent ID generation starting from 1.

Verification

  • 77/77 unit tests in lib.rs passing.
  • Stress tests for large amounts and high goal volume passing.
  • TTL re-bump verification passing.
  • Gas benchmarks within expected ranges.

@Baskarayelu
Copy link
Copy Markdown
Contributor

@menawar Please resolve the conflicts

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement strict target date validation for savings goals

2 participants