fix: resolve all CI/CD failures across frontend and contracts#164
Merged
Conversation
Frontend (TypeScript/ESLint): - App.tsx: fix broken JSX ternary chain, add missing BatchExpireInvoices and TreasuryManager imports, extend Tab type, remove unused imports and EXPECTED_NETWORK constant - soroban.ts: add cancelInvoice(), fix sendTransaction() calls (parse signed XDR string back to Transaction), replace window as any with typed WindowWithFreighter interface, err: any -> err: unknown - treasury.ts: replace window as any with typed WindowWithWallet interface, fix TransactionBuilder account cast, err: any -> unknown - TreasuryManager.tsx: fix SorobanRpc.Server -> Server, fix assembleTransaction call signature, fix sendTransaction XDR parsing - useInvoice.ts: add cancel() method backed by cancelInvoice() - useToast.ts: extract useToast hook from Toast.tsx into its own file (fixes react-refresh/only-export-components warning) - Toast.tsx: export ToastContext and ToastContextValue, remove useToast - AdminAnalytics.tsx: remove unused startDate/endDate from useMemo deps - BatchExpireInvoices.tsx: err: any -> err: unknown - TokenAllowlist.tsx: err: any -> err: unknown in all catch blocks - qrcode.ts: remove unused EC_LEVEL_M, getAlphanumericValue, getMode Rust contracts: - settlement/src/lib.rs: remove duplicate SettlementError enum (the stale one with InsufficientApprovals=3); keep the correct definition with AlreadyApproved=3 that the tests reference
- package-lock.json: regenerate to sync esbuild@0.28.1 entries; the stale lockfile was missing all @esbuild/* platform packages at 0.28.1, causing npm ci to fail with EUSAGE on the build-and-lint job - scripts: add execute bit to lint-docs.sh, generate_abi_metadata.sh, check_abi_snapshot_hygiene.sh, coverage.sh; these were missing +x so the lint-docs and check-abi-snapshots CI jobs exited 126/127 - COMEBACKHERE-contracts (compliance, invoice, treasury): replace all env.register_contract(None, X) with env.register(X, ()); the old API is deprecated and -D warnings turns deprecations into hard errors - contracts/invoice, contracts/settlement: same register_contract -> register fix for our own contracts workspace (used by Backend Tests)
build-and-lint:
- Upgrade vite ^5.2.0 → ^6.0.0 in package.json; vitest@4 declares
peerDep vite@^6|^7|^8, causing npm to resolve esbuild@0.28.1 which
was missing from the lockfile — regenerate package-lock.json
unit (Backend Tests):
- contracts/invoice and contracts/settlement use soroban-sdk v21 which
only has register_contract(); already reverted in previous commit
check-abi-snapshots / generate-abi-metadata:
- generate_abi_metadata.sh looked for COMEBACKHERE-contracts at
$ROOT_DIR/../ but CI checks it out into $ROOT_DIR/COMEBACKHERE-contracts
(same directory as the repo checkout); now probes both locations
contract coverage:
- cargo-llvm-cov does not accept --lcov and --html in the same
invocation; split into two separate cargo llvm-cov calls
lint-docs:
- Add MD036 false (emphasis-as-heading), MD041 false (first-line-h1),
MD060 false (table-column-style) to .markdownlint.json — these
rules fire on intentional doc patterns (bold labels, PR template
section headings, wide table rows)
- Convert **Bold** section labels to #### headings in api-reference.md
and contract-interaction-guide.md
- Apply markdownlint --fix to all docs (blank lines, table separators)
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 all failing CI checks across the monorepo.
Frontend (TypeScript build + ESLint)
App.tsx
batch-expireandtreasuryarms were appended after the already-closedelse, making the JSX unparseableBatchExpireInvoicesandTreasuryManagerTabtype to include"batch-expire"and"treasury"WalletBarimport andEXPECTED_NETWORKconstantsoroban.ts
cancelInvoice()function (was used byInvoicePaymentbut never defined)sendTransaction()calls inbatchExpireInvoicesandreleaseEscrow— signed XDR string must be parsed back to aTransactionviaTransactionBuilder.fromXDR()window as anywith typedWindowWithFreighterinterfaceerr: any→err: unknownin all catch blockstreasury.ts
window as anywith typedWindowWithWalletinterfacenew Server()instantiation (was wrongly usingSorobanRpc.Server)TransactionBuilderaccount cast (Parameters<typeof TransactionBuilder>[0]is invalid —TransactionBuilderis a class constructor)err: any→err: unknownTreasuryManager.tsx
SorobanRpc.Server→Server(top-level export)SorobanRpc.assembleTransaction→assembleTransaction(top-level export)sendTransaction(signed)— parse XDR string back toTransactionfirstTransactionBuilderaccount castuseInvoice.ts
cancel()method backed by newcancelInvoice()utilityInvoicePaymentwas destructuringcancelfrom the hook but it wasn't definedToast.tsx / useToast.ts
useToasthook out ofToast.tsxintosrc/hooks/useToast.tsreact-refresh/only-export-componentswarning (hooks mixed with components)ToastContextandToastContextValuefromToast.tsxfor the hook to consumeAdminAnalytics.tsx
startDate/endDatefromuseMemodependency array — the callback only readsMOCK_DATA(a module-level constant), so those deps caused a spuriousreact-hooks/exhaustive-depswarningBatchExpireInvoices.tsx / TokenAllowlist.tsx / qrcode.ts
err: any→err: unknownin catch blocksEC_LEVEL_M,getAlphanumericValue,getModefromqrcode.tsRust contracts
contracts/settlement/src/lib.rs
SettlementErrorenum definition (the stale one withInsufficientApprovals = 3)AlreadyApproved = 3, which all tests referenceWhat was tested
npx tsc -b: ✅ 0 errorsnpm run lint: ✅ 0 errors, 0 warningscargonot available in this environment; settlement fix is a trivial duplicate-removal that the CI contract workflow will verify