Repository navigation
fix(contracts): fix clippy warnings and milestone XDR test vectors - #209
Merged
oluwaseyi1996-netizen merged 2 commits intoOct 20, 2026
Conversation
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 it fixes
Fixes failing CI on
mainwhere the Contracts – fmt, clippy, test, wasm job failed during:cargo clippy --all-targets -- -D warningsdue to unused importTryIntoVal.cargo testwheretest::create_accepts_the_backends_pinned_milestone_xdrpanicked with"milestone XDR does not parse".Root cause
contracts/escrow/src/test.rs,TryIntoValwas imported fromsoroban_sdk, but the test helpercreate_rawwas refactored to parse XDR payloads viafrom_xdr_base64and invoke native SDK methods, leavingTryIntoValunused. With-D warningsenforced in CI, this triggered a fatal build error.BACKEND_MILESTONES_XDRandUNSORTED_MILESTONES_XDRincontracts/escrow/src/test.rswere split across multiple lines with trailing backslashes. An unintended duplicate character resulted in a 401-character string instead of the valid 400-character encoding produced by@stellar/stellar-sdkandbackend/src/lib/escrowArgs.ts. As base64 requires character lengths divisible by 4, XDR deserialization failed immediately.The fix and why
TryIntoValfromcontracts/escrow/src/test.rs:20.backend/src/__tests__/escrowArgs.test.tsandfrontend/src/lib/stellar.test.ts.How it was tested
cargo fmt --all -- --check— clean, 0 formatting diffs.cargo clippy --all-targets -- -D warnings— clean, 0 warnings/errors.cargo test— all 64 contract tests passed (includingcreate_accepts_the_backends_pinned_milestone_xdrandcreate_rejects_milestone_maps_whose_keys_are_not_sorted).stellar contract build— wasm contracts built successfully.npm run lint— passed.npx tsc --noEmit— passed.npm test— all 361 tests passed.npm run build— production build succeeded.npx prisma generate— passed.npx prisma migrate deploy& schema drift check — passed.npx tsc --noEmit— passed.npm test— all 411 tests passed.npm audit&cargo auditcompleted.Follow-up worth filing separately