Skip to content

fix(contracts): fix clippy warnings and milestone XDR test vectors - #209

Merged
oluwaseyi1996-netizen merged 2 commits into
vatal-system:mainfrom
oluwaseyi1996-netizen:fix/escrow-test-unused-import
Oct 20, 2026
Merged

oluwaseyi1996-netizen merged 2 commits into
vatal-system:mainfrom
oluwaseyi1996-netizen:fix/escrow-test-unused-import

Conversation

@oluwaseyi1996-netizen

@oluwaseyi1996-netizen oluwaseyi1996-netizen commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What it fixes

Fixes failing CI on main where the Contracts – fmt, clippy, test, wasm job failed during:

  1. cargo clippy --all-targets -- -D warnings due to unused import TryIntoVal.
  2. cargo test where test::create_accepts_the_backends_pinned_milestone_xdr panicked with "milestone XDR does not parse".

Root cause

  1. Unused Import: In contracts/escrow/src/test.rs, TryIntoVal was imported from soroban_sdk, but the test helper create_raw was refactored to parse XDR payloads via from_xdr_base64 and invoke native SDK methods, leaving TryIntoVal unused. With -D warnings enforced in CI, this triggered a fatal build error.
  2. Malformed Base64 Test Constants: The test vectors BACKEND_MILESTONES_XDR and UNSORTED_MILESTONES_XDR in contracts/escrow/src/test.rs were 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-sdk and backend/src/lib/escrowArgs.ts. As base64 requires character lengths divisible by 4, XDR deserialization failed immediately.

The fix and why

  1. Clean Imports: Removed TryIntoVal from contracts/escrow/src/test.rs:20.
  2. Accurate XDR Constants: Replaced the malformed multiline strings with the canonical 400-character base64 vectors matching backend/src/__tests__/escrowArgs.test.ts and frontend/src/lib/stellar.test.ts.

How it was tested

  • Contracts CI Job:
    • 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 (including create_accepts_the_backends_pinned_milestone_xdr and create_rejects_milestone_maps_whose_keys_are_not_sorted).
    • stellar contract build — wasm contracts built successfully.
  • Frontend CI Job:
    • npm run lint — passed.
    • npx tsc --noEmit — passed.
    • npm test — all 361 tests passed.
    • npm run build — production build succeeded.
  • Backend CI Job:
    • npx prisma generate — passed.
    • npx prisma migrate deploy & schema drift check — passed.
    • npx tsc --noEmit — passed.
    • npm test — all 411 tests passed.
  • Advisory Job:
    • npm audit & cargo audit completed.
  • Verified in live GitHub Actions run #39451250986 with 100% green checks across all jobs.

Follow-up worth filing separately

  • None needed; all contracts, backend, and frontend checks are fully passing and verified green in CI.

@oluwaseyi1996-netizen oluwaseyi1996-netizen changed the title fix(contracts): remove unused TryIntoVal import in escrow tests fix(contracts): fix clippy warnings and milestone XDR test vectors Oct 20, 2026
@oluwaseyi1996-netizen
oluwaseyi1996-netizen merged commit 3b1e291 into vatal-system:main Oct 20, 2026
4 checks passed
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.

1 participant