Wandoo - #1430
Merged
Merged
Conversation
added 9 commits
August 16, 2026 13:30
…ariant and PAYMENT_TIMEOUT_LEDGERS constant The mark_upgrade function referenced CrossAssetPaymentError::UpgradeVersionUnchanged which was not defined in the error enum, causing a compilation error. Similarly, initiate_payment used PAYMENT_TIMEOUT_LEDGERS which was never defined. - Add UpgradeVersionUnchanged = 17 to CrossAssetPaymentError enum - Add PAYMENT_TIMEOUT_LEDGERS constant (17,280 ledgers ≈ 24 hours at 5s intervals)
…sitions Previously, update_status could transition a payment directly to 'complete' or 'failed' without moving escrowed funds. This created dead-end states where funds were permanently locked — neither settled to the recipient nor refunded to the sender. Now update_status only allows pending → process. Terminal transitions (complete/failed) must go through complete_payment/fail_payment which transfer escrowed funds as part of the state change. This closes the gap where a payment could reach a terminal status with funds still locked in the contract.
… machine Update 19 tests that relied on update_status to reach terminal states (complete/failed). These tests now use complete_payment and fail_payment which are the correct entry points for terminal transitions. Affected tests: - Valid transition tests now use complete_payment/fail_payment - Invalid transition tests reach terminal via settlement functions - Double-transition tests use try_complete_payment/try_fail_payment - State machine and amount tests use proper settlement paths - Admin transfer test fixed to use valid 'process' status
…elease Add 5 new tests covering the settlement flow: - test_settle_happy_path_transfers_funds_to_recipient: verifies funds move - test_double_settlement_prevented: second settle blocked after first - test_settle_after_fail_is_blocked: settle blocked after refund - test_update_status_cannot_bypass_settlement: update_status cannot reach terminal states, funds remain safely locked until proper settlement - test_every_payment_state_has_exit_path: all 5 state paths (pending→complete, pending→process→complete, pending→failed, pending→process→failed, pending→expired) resolve escrowed funds Total: 86 tests passing (81 existing + 5 new)
- Add dev-dist to globalIgnores to skip generated workbox files - Fix syntax error in helpers.ts (STANDALONE passphrase → STANDALONE_PASSPHRASE) - Remove unused imports: beforeEach, hash, ContractSpec - Remove unused variables: simUpload, returnVal, isClearingCache, handleClearOfflineData, completedStepIndex - Add AuthResponse type to Login.tsx to replace unsafe any from response.json() - Wrap async onSubmit/onClick handlers with void to fix no-misused-promises - Add vitest.sdk.config.ts to tsconfig.eslint.json includes - Disable no-redundant-type-constituents for test files (SDK TransactionResponse type)
stellar-cli 27.1.0 requires rustc 1.93.0 but CI runners have rustc 1.89.0. Pin to 25.2.0 which supports the current rustc version.
Run prettier --write to resolve all formatting inconsistencies.
…and fix i18n mocks - Add src/__tests__/sdk/** to vitest exclude list (SDK tests need live Stellar network, run separately via vitest.sdk.config.ts) - Add initReactI18next to react-i18next mocks in Settings, PayrollScheduler, and SettingsErrorIsolation tests (required by src/i18n.ts import)
Tests expected translated button text ('Download QR', 'Print QR') but
the component uses translation keys. Added useTranslation mock with the
required walletQr.* translations.
Collaborator
|
Kindly check failing checks @wandooadzer-cmyk thank you |
added 8 commits
August 17, 2026 09:00
- Add global react-i18next mock in setup.ts that loads English translations from en/translation.json and handles fallback parameters - Export I18nextProvider and Trans from the mock for tests that use them - Add useAuth and useWallet mocks to Login.test.tsx - Add @tanstack/react-query mock to BulkPayrollUpload.test.tsx Reduces test failures from 88 to 14 (remaining are pre-existing structural issues in component assertions).
- Add extern crate std for catch_unwind support - Replace cpu_instruction_count/memory_bytes_count with cpu_instruction_cost/memory_bytes_cost (SDK API change) - Replace env.ledger().set(n) with env.ledger().set_sequence_number(n) - Replace std::panic::catch_unwind with client.try_execute_batch - Fix p2 variable reference to payments3 - Fix weekly/monthly limit tests to advance ledger sequence properly (daily limit requires 17,280 ledgers between resets) All194 tests passing.
Add PendingAdmin and StateVersion to DataKey enum, and NoPendingAdminTransfer/NotProposedAdmin to ContractError enum. These were referenced in the admin transfer logic but never defined, causing compilation failure.
The verify-build job had no prior build step, so -s caused all contracts to fail with 'WASM artifact not found'. Let the verify script build the contracts itself.
stellar CLI v25+ builds to wasm32v1-none instead of wasm32-unknown-unknown. Update verify_contract.sh and verify.yml to auto-detect the correct WASM output directory.
Collaborator
|
Thank you @wandooadzer-cmyk for your contributions |
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
Fixes the escrow settlement gap in
cross_asset_paymentwhereupdate_statuscould mark a payment as "complete" or "failed" without transferring escrowed funds, permanently locking them in the contract.What Changed
UpgradeVersionUnchangederror variant andPAYMENT_TIMEOUT_LEDGERSconstant that prevented compilationvalidate_status_transitionsoupdate_statuscan only advance payments toprocess. Terminal transitions (complete/failed) must go throughcomplete_payment/fail_paymentwhich transfer escrowed funds as part of the state changeupdate_statusto reach terminal states — they now usecomplete_payment/fail_paymentupdate_statusbypass prevention, and exhaustive state exit-path coverageTesting
cargo test -p cross_asset_payment --target aarch64-apple-darwin86 tests passing (81 existing + 5 new), 0 failures.
New tests:
test_settle_happy_path_transfers_funds_to_recipient— funds move to recipient on settlementtest_double_settlement_prevented— secondcomplete_paymentcall blockedtest_settle_after_fail_is_blocked— settlement blocked after refundtest_update_status_cannot_bypass_settlement—update_statuscannot reach terminal statestest_every_payment_state_has_exit_path— all 5 paths (pending→complete, pending→process→complete, pending→failed, pending→process→failed, pending→expired) resolve escrowDocumentation
N/A
Checklist
Accessibility / Responsiveness
N/A — contract-only change, no UI impact.
Closes #446
Notes
Breaking change:
update_statuscan no longer transition payments directly tocompleteorfailed. Any off-chain code or admin tooling that relied onupdate_statusfor terminal transitions must switch tocomplete_payment(for settlement) orfail_payment(for refunds). Thepending → processtransition viaupdate_statusis unchanged.