feat: implement preflight balance checks#162
Open
Majormaxx wants to merge 1 commit intoGildado:mainfrom
Open
Conversation
Collaborator
|
@Majormaxx check out the conflicts and resolve so I can merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Preflight Balance Check Service as specified in Issue #152. Introduces a validation layer that runs before the existing transaction simulation step, catching account-level issues early and providing clear, actionable feedback to the admin.
Problem
Previously, payroll batch submissions went straight to Horizon simulation without first verifying that the organization has adequate XLM to cover fees or that employee destination accounts exist with proper trustlines. This resulted in opaque simulation failures that were difficult for admins to diagnose.
Changes
frontend/src/services/stellarValidation.tsloadAccount, and confirms non-XLM trustlines.frontend/src/hooks/useFeeEstimation.tsvalidatePreflight()wrapper that estimates batch fees and invokes the validation service in a single call.frontend/src/pages/PayrollScheduler.tsxhandleInitializeflow. Validation errors now block simulation and surface via the new panel. Added an employee wallet address input field.frontend/src/components/PreflightReportPanel.tsxAcceptance Criteria
Testing
npx tsc --noEmitpasses with zero errorsCloses #152.