Repository navigation
fix(ci): fix the lockfile, the migration comparison and the web type errors - #601
Merged
adenueltech merged 2 commits intoOct 22, 2026
Conversation
…errors `main` is red in three places, and none of them has anything to do with whatever a pull request happens to change. - the api crate declares `reqwest` but never uses it, and the `engipay-api` entry in `Cargo.lock` does not list it either, so every step that passes `--locked` stops with "cannot update the lock file". The dependency is removed, so the manifest and the lock file agree again. - `verify-migrations.sh` compares two `pg_dump` outputs but filters out the comments and the blank lines only. `pg_dump` also brackets the dump with `\restrict` and `\unrestrict` lines carrying a random token, so the two passes never matched. Those lines are filtered out now. - the web app does not type check. The Naira ramp was written against an API that does not exist: it asked for `asset_code` and `stellar_account`, read `id` and `url` off the response and imported three types the client does not export. It calls the API the api crate actually serves now. The batch payments page uses the names the client exports, the buy page calls `formatRate` the way it is defined, and the send page imports `Link` and `ArrowUpRight`.
|
@EmmanuelDesmond is attempting to deploy a commit to the emmanuel adewunmi's projects Team on Vercel. A member of the Team first needs to authorize it. |
4 of 5 tasks
…is non-negative `change_sats` is a `u64`, so `assert!(prepared.change_sats >= 0)` is always true and clippy rejects it as an absurd extreme comparison. The test withdraws 60_000 from 80_000 of input, so the change is 20_000 less the fee.
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.
What this changes
mainis red, and it has been red for reasons that have nothing to do with whatever a pull request happens to change. Three CI jobs fail, each for its own reason:backend/crates/api/Cargo.tomldeclaresreqwest.workspace = true, but theengipay-apientry inCargo.lockdoes not listreqwest. Every step that passes--lockedstops withcannot update the lock file.backend/scripts/verify-migrations.shcompares twopg_dumpoutputs, but filters out--comments and blank lines only.pg_dumpalso brackets the dump with\restrictand\unrestrictlines carrying a random token, so the two passes never agree and the schemas always "differ".npm run typecheckreports 18 errors across four files. The Naira ramp, the batch payments page, the buy page and the send page were merged without ever type-checking.This pull request fixes those three, and one more thing it found on the way.
1. The api crate does not use
reqwest. Nothing underbackend/crates/apirefers to it. The dependency is removed, so the manifest matchesCargo.lockagain andcargo clippy --locked,cargo test --lockedandcargo deny checkcan run.2.
pg_dump's random tokens are filtered out of the schema comparison.capture_schemanow drops the\restrictand\unrestrictlines along with the comments. The two passes then compare the schema, and nothing else.3. The web app type-checks again.
app/(app)/buy/page.tsxcalledformatRate(liveQuote.rate_kobo, liveQuote.asset).formatRatetakes the quote and readskobo_per_unitoff it, so the call is nowformatRate(liveQuote), the waylib/buy.test.tsalready calls it.app/(app)/send/page.tsxusedLinkandArrowUpRightwithout importing them. They are imported now:Linkfromnext/link,ArrowUpRightfromlucide-react.app/(app)/batch/page.tsximportedBatchPaymentStatusResponseandBatchPaymentRowResult; the client exportsBatchPaymentStatusandRowResult. The names are corrected.approveBatchPaymentreturns nothing, so the page fetches the status again after approving instead of setting it from the empty response.components/naira/NairaAnchorRamp.tsxwas written against a Naira API that does not exist. It asked forasset_codeandstellar_account, readidandurloff the response, and importedNairaDepositResponse,NairaWithdrawalResponseandNairaTransactionStatusResponse, none of which the client exports. It now calls the API the api crate actually serves:POST /v1/naira/depositstakes{ amount }and returns{ transaction_id, sep24_id, interactive_url, status }.POST /v1/naira/withdrawalstakes{ amount, bank_account, bank_code, account_name }and returns the same shape.GET /v1/naira/deposits/:idandGET /v1/naira/withdrawals/:idreturnAnchorTransactionStatus.The ramp moves Naira into USDC and USDC back out to a bank account, and the api crate only ever deals in USDC, so the two asset pickers that had no effect on the request are shown as the asset they are rather than as a choice.
lib/naira-ramp.tsgainsgetBankByCode,isSep24TerminalandisSep24Success, which the ramp needs, and theSep24TransactionStatetype, the states of theanchor_statusenum the api crate stores.lib/naira-ramp.test.tscovers them.4. The change to the bitcoin sender test that #591 made does not hold. #591 turned
assert!(prepared.change_sats > 0 || prepared.change_sats == 0)intoassert!(prepared.change_sats >= 0), to clearclippy::double_comparisons.change_satsis au64, so the new assertion is always true and clippy rejects it as anabsurd_extreme_comparisons. The test withdraws 60_000 from 80_000 of input, so the change is 20_000 less the fee, and that is what it asserts now.What is still red, and why
Fixing the lock file lets clippy run for the first time, and it turns out that the api crate has never compiled on
main.cargo clippy --workspace --all-targetsreports 65 errors in the api crate's lib target and 102 more in its test target. None of them is caused by this pull request, and none of them is a lint: they are type errors, and the--lockedfailure was hiding every one of them.They come from three features that were each merged with code written against a different API than the one in the tree:
crates/api/src/routes/auth/stellar.rsstellar-xdrAPI - theint64,uint32anduint64aliases,TransactionEnvelope::TxV1,MuxedAccount::KeyTypeEd25519,Memo::MemoNone,TransactionV1Envelope::operations- while the workspace pinsstellar-xdr = "28".crates/api/src/routes/auth/evm.rsed25519-dalek = "2"andk256 = "0.13":SigningKey::signmoved to theSignertrait,PublicKey::to_encoded_pointandrecover_from_digestare gone, andsha2::Digestis not implemented for&[u8; 32].crates/api/src/routes/transfers.rs,withdrawals.rs,buy.rs,crates/api/src/lib.rsservices::receiptsAPI that does not exist:Receipthas no field namedkind,transaction_id,amount,created_at,sender_tagorrecipient_tag, there is noReceipt::new,ReceiptSigner::from_seedorReceiptSigner::from_config_or_test, the module isservices::receiptsand notservices::receipt, andAsset::from_symboldoes not exist.crates/api/src/routes/batch_payments.rsaxum::extract::Multipartis not in axum 0.8's default features, plus two unused imports.crates/api/src/routes/receipts.rscrate::state; the module iscrate::AppState.crates/api/src/routes/naira.rsamount_in,amount_outandamount_feeare not in scope, andamount_requestedis unused.The "Ledger guarantees (Postgres)" job fails at "Database-backed tests" for the same reason:
cargo testhas to compile the api crate.These are not lint fixes. They are a rewrite of the wallet sign-in code against the dependency versions in the tree, or a decision to pin the older versions instead - and both of those are decisions about money-handling code that belong in their own pull request, not in one that fixes CI.
How it was tested
cargo fmt --all --checkinbackend: passes.cargo metadata --locked --format-version 1inbackend: passes. It failed withcannot update the lock filebefore this pull request.npm run typecheck: passes. It reported 18 errors before this pull request.npm test: passes, 145 tests, including the new cases inlib/naira-ramp.test.ts./batch,/buy,/sendand/sellamong them.pg_dumpoutputs that differ only in their random\restricttoken: they now compare equal. On CI the step now reportsSchemas match - migrations are idempotent.link.exeis missing and every build script fails to link.cargo fmtandcargo metadatado not need a linker and were run in full;cargo clippyandcargo testneed CI.Checklist
npm run typecheck,npm testandnpm run buildpass (web app changes)cargo fmt,cargo clippy -- -D warningsandcargo testpass (backend changes) -cargo fmt --all --checkandcargo metadata --lockedpass locally; clippy and test are blocked by the api crate's own type errors, listed above.envfiles are includedOne thing to know before merging
#594 adds
"reqwest"to theengipay-apientry inbackend/Cargo.lock, which is the other way of making the lock file agree with the manifest. The api crate does not usereqwest: not inprice_source.rs, the code #594 adds, and nowhere else underbackend/crates/api. This pull request drops the dependency instead and leaves the lock file alone.If both are merged, the manifest no longer declares
reqwestwhile the lock file still lists it inengipay-api, and every step that passes--lockedstops again withcannot update the lock file. #594's lock file hunk should be dropped, or that branch rebased on this one.