fix(soroban): mock invokeContract returns real results; regression tests for #581/#582 - #622
Open
jajafwangshak86-ops wants to merge 1 commit into
Open
Conversation
…ith regression tests - mock-client invokeContract now resolves with a deterministic result instead of null data, so the Soroban screen renders a real result (fixes the 'Not implemented' symptom from Sorokit#573). - add regression tests covering the Sorokit#581 native form submission (type=submit buttons linked to the parent form) and Sorokit#582 ContractEventFeed polling restart on contractId change. - fix SorobanPanel/TransactionPanel test harness so the mocked context exposes the client the panels actually read.
|
@jajafwangshak86-ops Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #573
Closes #581
Closes #582
What changed
#573 —
invokeContractreturns "Not implemented"Root cause was the mock client:
soroban.invokeContractalways resolved withdata: null, and the Soroban screen renders a null result as "Not implemented". No component rendering was at fault. Fixed at the source insrc/lib/mock-client.ts— the mock now resolves with a deterministic, non-null result ({ success: true, result: {...}, txHash }), so the panel shows a real invocation result.#581 — unsafe casts on submit buttons
Verified the offending code is already gone from
main: bothSorobanPanel.tsxandTransactionPanel.tsxopen their forms natively viatype="submit"buttons linked through theformattribute. This PR pins that behaviour with regression tests so it can't silently regress:SorobanPanel.test.tsx— Invoke button istype="submit", points at the form id, and clicking it reaches the form'sonSubmitand a real invocation.TransactionPanel.test.tsx— Send Payment button istype="submit"tied to the form.#582 — ContractEventFeed stale-closure polling
Verified the fix is already in
main:loadis memoized withuseCallback([contractId, limit, filterTypes, client])and the polling interval effect restarts whencontractIdchanges. Addedpolling contractId switching (#582)regression tests that switchcontractIdmid-poll (with fake timers) and assert every poll after the switch hits the NEW contract id, plus a Live-toggle pause/resume test.Test harness fix
SorobanPanel/TransactionPaneltests mockeduseSorokitwithout aclient, so invocations never reached the mocked API (the pre-existing suite failures). The mocks now expose the client the panels actually read, bringing the panels' success-state tests back to green.Verification
npm run typecheckpasses.eslinton changed files passes.117 passed / 6 failed(the 6 remaining are pre-existing, unrelated to this PR:ContractEventFeedJSON-export tests query/export json/iagainst anaria-labelof"Export {n} events as JSON", and 3TransactionPaneltests that override the context mock with balance arrays).Commits: 1