Skip to content

feat: implement comprehensive deadline enforcement for escrows#121

Merged
Cedarich merged 8 commits intoStayLitCodes:mainfrom
DavisVT:feature/deadline-enforcement
Feb 26, 2026
Merged

feat: implement comprehensive deadline enforcement for escrows#121
Cedarich merged 8 commits intoStayLitCodes:mainfrom
DavisVT:feature/deadline-enforcement

Conversation

@DavisVT
Copy link
Contributor

@DavisVT DavisVT commented Feb 25, 2026

  • Add EXPIRED status as terminal state
  • Create expire endpoint for depositors and arbitrators
  • Update state machine to support expiration transitions
  • Add guards preventing operations on expired escrows
  • Update scheduler to auto-expire overdue escrows
  • Add comprehensive test coverage (13 new tests)
  • Include full documentation and usage examples

Closes deadline enforcement requirements:

  • Explicit lifecycle rules with EXPIRED state
  • Deadline-based behaviors using current time
  • Authorization for depositor and arbitrator
  • Automatic expiration via scheduler
  • Event logging and webhook dispatch
  • Invariants enforced (no ops after expiry)
  • Full test coverage for all scenarios

closes #94

- Add EXPIRED status as terminal state
- Create expire endpoint for depositors and arbitrators
- Update state machine to support expiration transitions
- Add guards preventing operations on expired escrows
- Update scheduler to auto-expire overdue escrows
- Add comprehensive test coverage (13 new tests)
- Include full documentation and usage examples

Closes deadline enforcement requirements:
- Explicit lifecycle rules with EXPIRED state
- Deadline-based behaviors using current time
- Authorization for depositor and arbitrator
- Automatic expiration via scheduler
- Event logging and webhook dispatch
- Invariants enforced (no ops after expiry)
- Full test coverage for all scenarios
@DavisVT
Copy link
Contributor Author

DavisVT commented Feb 25, 2026

@Cedarich pls review
thanks

@Cedarich
Copy link
Contributor

Kindly resolve conflicts and fix build errors

@DavisVT
Copy link
Contributor Author

DavisVT commented Feb 25, 2026

@Cedarich it's done

@Cedarich
Copy link
Contributor

Kindly address lint errors

- Fix missing closing parenthesis in logEvent call
- Replace 'as any' with proper 'as UpdateResult' type casting
- Ensure TypeScript type safety in test mocks
@DavisVT
Copy link
Contributor Author

DavisVT commented Feb 25, 2026

@Cedarich That's done

@Cedarich
Copy link
Contributor

Please address lint error

- Remove extra closing parenthesis on line 307
- Fix syntax error in expire method
@Cedarich
Copy link
Contributor

There’s conflict

@DavisVT
Copy link
Contributor Author

DavisVT commented Feb 25, 2026

@Cedarich it should be done now

@Cedarich
Copy link
Contributor

Please Run npm run lint and fix lint errors

@DavisVT
Copy link
Contributor Author

DavisVT commented Feb 26, 2026

@Cedarich just found out there was an old duplicated file causing the problem so i remove it
should be good now

@Cedarich
Copy link
Contributor

Please address lint

@Cedarich
Copy link
Contributor

please resolve conflicts let merge.

@DavisVT
Copy link
Contributor Author

DavisVT commented Feb 26, 2026

i've resolved it

@Cedarich Cedarich merged commit 4cb3024 into StayLitCodes:main Feb 26, 2026
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.

Escrow Lifecycle & Deadline Enforcement (Auto-Expiry + Forced Actions)

2 participants