fix: repair lib/soroban.ts + app/create mangled by the #379 merge - #409
fix: repair lib/soroban.ts + app/create mangled by the #379 merge#409mhikel66 wants to merge 2 commits into
Conversation
…col#379 merge The conduit-protocol#379 merge left lib/soroban.ts non-compiling: invokeContract's body had a stray fragment of an inlined poll loop (referencing an out-of-scope `status`, plus a leftover `}, { context, signal })` from the withRetry call) wedged between the submit step and the real `return pollForConfirmation(...)`. tsc bailed with 'Declaration or statement expected', which is why every downstream CI job was red even past npm ci. - invokeContract: drop the mangled fragment; it already returned pollForConfirmation(hash, ...). - pollForConfirmation: finish the conduit-protocol#362 change it was mid-refactor on — return InvokeContractResult ({ hash, returnValue }) instead of a bare string, capturing status.returnValue on SUCCESS so callers like createStream can read the assigned stream_id. - Export resetFeeStatsCache() and call it in soroban-pipeline.test's beforeEach — the module-level fee cache (intentionally shared across invokeContract calls) was leaking between test cases. - Update soroban-pipeline / stream / tokens tests for the new InvokeContractResult shape and the flags-first field parsing order.
…it-protocol#394) app/create/page.tsx imported isValidStellarPublicKey but the schema's .refine() calls isValidStellarAddress — a name that was never in scope, so the file failed to compile once the soroban.ts syntax error above it was cleared. - Fix the import to isValidStellarAddress (the G…-or-C… check the schema actually wants; both forms are 56 chars so the existing length checks still hold). - Replace the hand-rolled zodResolver (first-error-only, loose typing that surfaced as a FieldError-not-ReactNode error at the recipient error line) with @hookform/resolvers/zod, already a dependency. - Update the create-page tests: mock checkRecipientExists and wait out the 600ms recipient-check debounce before submitting, so onSubmit's conduit-protocol#363 'still verifying' guard doesn't short-circuit them.
080e66a to
2434405
Compare
|
Hey @mhikel66! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
|
This branch predates #362/#363 and the shared |
The #379 merge left
mainnon-compiling. Two independent syntax/scope errors,one hidden behind the other:
lib/soroban.ts— mangledinvokeContractinvokeContract's body had a stray fragment of an inlined poll loop(referencing an out-of-scope
status, plus a leftover}, { context, signal })from the
withRetrycall) wedged between the submit step and the realreturn pollForConfirmation(...).tscbailed with "Declaration or statementexpected".
#362refactorpollForConfirmationwas mid-way through: it nowreturns
InvokeContractResult({ hash, returnValue }) instead of a barestring, capturing
status.returnValueon SUCCESS socreateStreamcan readthe assigned
stream_id.resetFeeStatsCache()and call it insoroban-pipeline.test'sbeforeEach— the module-level fee cache leaked between test cases.app/create/page.tsx— stale import + hand-rolled resolver (#394)Imported
isValidStellarPublicKeybut the Zod schema's.refine()callsisValidStellarAddress(never in scope).isValidStellarAddress.zodResolver(first-error-only; loose typing thatsurfaced as a
FieldError-not-ReactNodeerror) with@hookform/resolvers/zod, already a dependency.Verification (local)
Test updates:
soroban-pipeline.test.ts,stream.test.ts,tokens.test.ts,create/__tests__/page.test.tsx.CI note
CI here stays red until two separate blockers land:
npm cifails on the npmmirror.com lockfile URLs + the pre-renamegit+sshSDK dep (fork PRs fix(ci): point SDK to streamFi-sdk HTTPS and regenerate lockfile (Closes #404) #405 / fix: resolve assigned stream and CI issues #406 target this).maindoesn't build (aSignerregression from its #498 merge), so the SDK's
preparestep fails duringnpm cieven once the lockfile is fixed.This PR is the code-repair piece and is verified locally against those.