Skip to content

fix: sync vendor registry contract client#106

Draft
Davidemulo wants to merge 1 commit into
StepFi-app:mainfrom
Davidemulo:fix/vendor-registry-client-96
Draft

fix: sync vendor registry contract client#106
Davidemulo wants to merge 1 commit into
StepFi-app:mainfrom
Davidemulo:fix/vendor-registry-client-96

Conversation

@Davidemulo

Copy link
Copy Markdown

Summary

Closes #96

Synchronizes the vendor-registry client with the deployed Soroban contract so vendor checks use the current function names, Stellar Address arguments, and typed status model. It also narrows missing-vendor handling to contract error code 4 so integration drift is logged and fails loudly.

This repo is for the NestJS backend API only

  • My changes are inside src/ or test/ (plus the mandatory progress tracker)
  • I have NOT added React, React Native, or frontend component files
  • I have NOT added Rust or Soroban contract code
  • This is NestJS/TypeScript backend work

Type of change

  • Bug fix
  • New endpoint
  • New service or module
  • Database migration
  • Background job
  • Test coverage

Changes Made

  • Invoke is_active and get_vendor_info with Address ScVals
  • Replace the stale active boolean with the Pending/Approved/Suspended/Rejected VendorStatus union
  • Reject unknown status values and rethrow non-vendor-not-found contract failures as ContractReadError
  • Update the vendor mock and public type exports
  • Add client-level tests for exact function names, address encoding, status validation, and error handling
  • Update context/progress-tracker.md

Testing

  • npm run build passes with zero TypeScript errors
  • npm test passes — 29 suites and 322 tests
  • No new any types introduced anywhere
  • Swagger decorators not applicable — no endpoints changed
  • Migration not applicable — no schema changes
  • New unit tests cover the changed client behavior

Commands run:

  • npm run build
  • npm test -- --runInBand
  • npx eslint on all changed TypeScript files

Context files reviewed

  • context/architecture-context.md
  • context/code-standards.md
  • context/progress-tracker.md updated

The current StepFi-Contracts vendor-registry lib.rs, types.rs, and errors.rs were also reviewed to confirm the deployed signatures, status variants, and VendorNotFound error code.

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.

critical: fix vendor-registry client function names, argument types, and status mapping

1 participant