Skip to content

docs(contract): improve invariant test guidance - #843

Open
edehvictor wants to merge 766 commits into
leojay-net:mainfrom
edehvictor:docs/invariant-test-docs-609
Open

docs(contract): improve invariant test guidance#843
edehvictor wants to merge 766 commits into
leojay-net:mainfrom
edehvictor:docs/invariant-test-docs-609

Conversation

@edehvictor

Copy link
Copy Markdown
Contributor

Closes #609

Changes

  • document the accounting invariant strategy in stellar-contracts/CONTRIBUTING.md
  • add an invariant testing overview to stellar-contracts/README.md
  • improve inline Rust documentation for check_invariants and the property-based deposit tests
  • include the inherited contract test syntax repair required for current CI parsing

Testing

  • not run locally in full
  • cargo fmt parsing succeeded after the syntax repair, but full cargo test did not complete within the local timeout on this machine
  • GitHub CI should validate the branch end to end

Anthony-19 and others added 30 commits March 29, 2026 18:55
…-net#294, leojay-net#301

- fix(contract): emit event in set_operator for off-chain monitoring (leojay-net#390)
- feat(frontend): add CSV export to ReceiptDrawer with accessible button (leojay-net#391)
- feat(frontend): add Zod validation schemas for all API route inputs (leojay-net#294)
- fix(frontend): deduplicate chat history entries on page reload (leojay-net#301)

Changes:
- Added event emission in set_operator function with EVENT_VERSION
- Implemented CSV export functionality in ReceiptDrawer with proper escaping
- Created apiSchemas.ts with Zod schemas for create-recipient, initiate-transfer, and verify-account
- Updated all API routes to use Zod validation with structured error responses
- Added deduplicateSessions method to ChatHistoryManager
- Updated loadFromLocalStorage to deduplicate sessions on load
- Updated createNewSession to deduplicate before saving
- Added unit tests for deduplication logic
- Fixed duplicate section in ChatHistorySidebar

All tests passing, lint checks clean.
- Change error.errors to error.issues (correct Zod API)
- Fix TransactionAmountDisplay import (named export)
- Update CSV export to use correct TransactionHistoryEntry properties
- Remove duplicate imports in ReceiptDrawer
…196-187

feat: add split-view comparison, advanced search, and markdown hardening
…y-consent-toggle

feat(frontend): add telemetry consent toggle in user settings
…draft-messages

feat(frontend): persist chat drafts with 500ms debounce
…r-rate-limit-utility-module

test(lib): add unit tests for rateLimit utility
fix(contract): prevent ReceiptIndex from using persistent storage for…
…idation_bug

Fix: Admin Transfer Validation & Test Stability
Faisat-Creator and others added 26 commits April 25, 2026 20:20
- Replace Date.now()/Date.now()+1 ID generation with crypto.randomUUID()
  to eliminate message ID collisions when two messages are created in the
  same millisecond
- Remove stale isLoading closure from cancelPendingRequest and sendMessage;
  read activeRequestControllerRef directly so cancellation works regardless
  of when React flushes the isLoading state update
- Drop isLoading from sendMessage useCallback dependency array (was causing
  the hook to re-create on every loading toggle, contributing to stale refs)
- Add regression tests: unique IDs under concurrent sends, cancel-before-
  state-flush, stale-closure AbortController reuse

fix(frontend): add keyboard shortcuts to ReceiptDrawer.tsx (leojay-net#528)

- Escape closes the drawer
- Backspace / Delete clears transaction history (when handler provided)
- Shortcuts are no-ops when the drawer is closed
- Added role=dialog + aria-modal=true + descriptive aria-label
- Surfaced shortcut hint in clear-history button title
- Added ReceiptDrawer.test.tsx covering all shortcut paths and aria attrs

docs: improve inline documentation for slippage threshold assertion (leojay-net#529)

- Expanded check_slippage Rustdoc with Parameters, Algorithm step-by-step,
  Overflow safety, and Errors sections
- Updated docs/slippage-threshold.md with Architectural notes explaining
  why cross-multiplication and the remainder guard are used

test(contract): add Soroban invariant tests for pause (leojay-net#527)

- test_pause_invariant_withdraw_blocked_while_paused
- test_pause_invariant_request_withdrawal_blocked_while_paused
- test_pause_invariant_total_deposited_unchanged_across_pause_unpause_cycle
- test_pause_invariant_only_admin_can_pause
- test_pause_invariant_paused_flag_persists_across_multiple_blocked_calls

Closes leojay-net#530
Closes leojay-net#529
Closes leojay-net#528
Closes leojay-net#527
…ontrast

feat(frontend): add accessible contrast to transaction filter chips
…t#521 leojay-net#522

feat(frontend): add auto-scroll behavior to TransactionAmountDisplay (leojay-net#522)
- Attach a containerRef to the wrapper div
- useEffect scrolls the element into view (smooth, nearest) whenever
  displayText changes, keeping the latest amount visible without manual
  scrolling
- Add two new unit tests: scroll on mount and scroll on displayText change

feat(frontend): add accessible color contrast telemetry to chatTelemetry (leojay-net#521)
- Add avatar_color_check to ChatEventName union
- Expose chatTelemetry.avatarColorCheck() public method that emits the
  new event with the payload enriched by withAccessibleAvatarContrast
  (contrast ratio, compliant flag, accessible text color)
- Add four unit tests covering compliant dark/light backgrounds, consent
  guard, and enriched payload shape

fix(frontend): resolve race condition in CCIPBridgeModal (leojay-net#520)
- Introduce transactionHashRef kept in sync with transactionHash state so
  pollTransferStatus always reads the latest hash without closing over a
  stale value
- Pass an abort signal object into each poll invocation; cleanup sets
  signal.aborted = true so in-flight async calls cannot mutate state after
  the modal closes or the effect re-runs
- Add two regression tests: no state update after modal closes mid-poll,
  and stale slow response does not overwrite a faster terminal response

docs: improve inline documentation for timelock role check (leojay-net#519)
- Add full JSDoc to queue_admin_action explaining the admin role check,
  timelock enforcement, arguments, return value, and error variants
- Add full JSDoc to execute_admin_action covering the role check rationale,
  off-by-one boundary semantics, arguments, and error variants
- Expand set_operator docs with a dedicated 'Role separation (timelock
  role check)' section explaining why admin/operator must stay separate,
  the two boundary checks (fix leojay-net#525), and all error variants

Closes leojay-net#519
Closes leojay-net#520
Closes leojay-net#521
Closes leojay-net#522
- Add integration test for MigrationCheckEvent emission in validate_withdrawal_quota
- Test verifies event is emitted when storage_version < ESCROW_STORAGE_VERSION
- Closes leojay-net#510
…ch-withdrawal

feat(contract): implement migration check for validate_withdrawal_quota
- Add Cmd/Ctrl+N for new chat
- Add Cmd/Ctrl+H for open history
- Add Cmd/Ctrl+B for open bridge modal
- Add Cmd/Ctrl+Shift+C for cancel request
- Add comprehensive unit tests for all keyboard shortcuts
- Ensure no regressions in existing functionality

Closes leojay-net#561
…rd-shortcuts

feat(frontend): add keyboard shortcuts to ChatInput.tsx
- Add smooth modal entrance/exit animations with backdrop blur
- Implement step-by-step slide transitions between form steps
- Add animated loading states, error messages, and success indicators
- Include beneficiary dropdown and save prompt animations
- Animate transfer timeline and status updates
- Use AnimatePresence for proper animation lifecycle management

Issue: leojay-net#556
…ortcuts

Feat/556 add framer-motion animation
…-527-multi-issue

fix(frontend): resolve race condition in useChat.ts (leojay-net#530)
…work-status-toast

feat(frontend): add network status toast to AuditTable
- Add detailed Rustdoc comments for set_limit_max_cap, get_set_limit_max_cap, and SetLimitMaxCapEvent
- Clarify that the global cap prevents future set_limit calls from exceeding the ceiling
- Note that existing token limits are not retroactively reduced
- Update FIAT_BRIDGE_README.md to include the new admin functions
- Improve DataKey::SetLimitMaxCap documentation

Closes leojay-net#552
…-limit-docs

docs: improve inline documentation for maximum cap limit
@edehvictor

Copy link
Copy Markdown
Contributor Author

@leojay-net can I get a review here

1 similar comment
@edehvictor

Copy link
Copy Markdown
Contributor Author

@leojay-net can I get a review here

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.

docs: improve inline documentation for invariant test