Skip to content

fix: address assigned issues #863, #867, #868 - #1027

Merged
k-deejah merged 1 commit into
Sorokit:mainfrom
investorUsman:fix/assigned-issues-863-867-868
Oct 22, 2026
Merged

k-deejah merged 1 commit into
Sorokit:mainfrom
investorUsman:fix/assigned-issues-863-867-868

Conversation

@investorUsman

Copy link
Copy Markdown

Resolves #863
Resolves #867
Resolves #868

Summary

This PR addresses the three remaining assigned issues in one comprehensive change set. Several pieces of the underlying work had already landed on main under earlier issue numbers (#732 and #737), so this PR hardens the persistence logic and extends the existing screen/dashboard test files to explicitly cover every acceptance criterion.

Changes

#863 — ContractEventFeed: preserve fromLedger across remounts

  • Hardened readPersistedFromLedger so corrupted, non-numeric, or negative sessionStorage values are ignored instead of being forwarded to getEvents(...) as NaN.
  • Guarded persistFromLedger against non-finite/negative ledger values.
  • Added regression tests covering:
    • The next ledger is persisted under the contract-specific sessionStorage key.
    • The previous contract's persisted key is removed when contractId changes.
    • A corrupted persisted value falls back to the default window rather than sending NaN.
    • Existing unmount/remount and explicit fromLedger precedence tests continue to pass.

#867 — NFTScreen tests

  • Extended NFTScreen.test.tsx to cover the loading, error, empty, and success states (already present) plus:
    • nft.getNfts is called with the connected wallet address.
    • The disconnected wallet prompt is rendered.
  • Uses createMockClient() from src/lib/mock-client.ts.

#868 — StakingDashboard tests

  • Extended StakingDashboard.test.tsx using the createMockClient() pattern in the mocked context.
  • Added coverage for applying an inline delegation adjustment (delegated total updates and refreshAccount is invoked).
  • handleClaimAll now refreshes the connected account after a successful claim so balances propagate outside the dashboard; the claim-all test asserts that refresh.
  • Existing validator rendering, delegation-form, rewards-total, and claim-all behaviour tests remain intact.

Testing

  • Full Vitest suite: 100 test files passed, 2039 tests passed
  • npx eslint on all changed files: clean
  • npx tsc -b --noEmit: clean

Notes

No unrelated files are included in this PR.

- ContractEventFeed: harden persisted fromLedger parsing/writes and add
  remount, contract-switch, and sessionStorage regression coverage (Sorokit#863)
- NFTScreen: verify address-scoped NFT fetches and the disconnected state (Sorokit#867)
- StakingDashboard: use the mock client pattern, cover delegation adjustment,
  and refresh the account after claim-all (Sorokit#868)
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@investorUsman 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! 🚀

Learn more about application limits

@k-deejah
k-deejah merged commit 5a3ac6d into Sorokit:main Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants